Variables are used for storing data in your script. With linux scripting you only use the $ at the beginning of the variable when calling it not when declaring the variable. It is common practice in shell scripting to name your variables with all capital letters. The = is used to set a variable.
Examples:
FIRSTNAME=Bob -- Sets variable FIRSTNAME to Bob
LASTNAME=Jones -- Sets variable LASTNAME to Jones
FULLNAME="$FIRSTNAME $LASTNAME" -- Sets variable FULLNAME to Bob Jones by referencing the variables FIRSTNAME and LASTNAME.
If you need to reference a variable in a string with characters attached to the value of the variable reference the variable with {} surrounding the variable name.
Example:
echo "${VARIABLE}s"
The Bash shell has many built in variables to make life easy for us.
BASH_VERSION -- Version of bash shell currently being used.
EUID -- Effective user ID of the current user.
GROUPS -- An array variable storing the list of groups the current user is a member of.
HOSTNAME -- contains the name of the current host.
PWD -- The present working directory.
RANDOM -- When referenced generates a random number between 0-32767. Giving RANDOM a value seeds the random number generator.
SECONDS -- The number of seconds since the shell was started.
UID -- The real UID of the current user.