Changes

Jump to: navigation, search

BASH Variables

373 bytes added, 08:18, 16 September 2008
Using a Variable's Value
echo "Hooray!"
fi
 
You may optionally place the variable name within curly-braces (useful if there is text immediately after the variable name):
 
NUMBER="12"
echo "You are in ${NUMBER}th place!"
 
= Adding to a Variable =
 
To add to a variable, assign a value to it which contains the existing value plus new data. For example, to add ":." to the end of the PATH variable:
 
PATH="$PATH:."
= Exporting Variables =

Navigation menu