Testing variables String-based if [ "$somevar" = "hello" ]; then if [ "$somevar" != "hello" ]; then Numeric-based if [ "$num" -lt 42 ]; then if [ "$num" -ge 42 ]; then File-based if [ -r "$fname" ]; then if [ "$fname" -nt "file.txt" ]; then Many more, for info: man test