Get current directory and concatenate a path

Sounds like you want: path=”$(pwd)/some/path” The $( opens a subshell (and the ) closes it) where the contents are executed as a script so any outputs are put in that location in the string. More useful often is getting the directory of the script that is running: dot=”$(cd “$(dirname “$0″)”; pwd)” path=”$dot/some/path” That’s more useful …

Read more

Difference between shell and environment variables

Citing this source, Standard UNIX variables are split into two categories, environment variables and shell variables. In broad terms, shell variables apply only to the current instance of the shell and are used to set short-term working conditions; environment variables have a farther reaching significance, and those set at login are valid for the duration …

Read more