Skip to content

Instantly share code, notes, and snippets.

@jessereynolds
Last active November 2, 2015 07:47
Show Gist options
  • Save jessereynolds/f136d1e6cd934e14236f to your computer and use it in GitHub Desktop.
Save jessereynolds/f136d1e6cd934e14236f to your computer and use it in GitHub Desktop.
variables in shell documentation eg curl
#!/bin/bash
export SERVER=xyz.example
export PATH='/foo/bar'
curl http://${SERVER}/${PATH}

parsed in your head:

curl http://<SERVER>/<PATH>

setting up shell variables:

export SERVER=xyz.example
export PATH='/foo/bar'

curl http://${SERVER}/${PATH}
SERVER=xyz.example \
  PATH='/foo/bar' \
  curl http://${SERVER}/${PATH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment