Bash variables

From wikinotes

Assignment

var="var"
FOO=${VARIABLE:=default} 

read -n 1 input  # user input to $input

test variable

test -z "$var" && echo "variable does not exist, or has no value"
test -n "$var" && echo "variable exists and has a nonzero value"

There are many more options. See man test.