• logical branching: if X, then Y
  • 	if [[ -f ~/.bash_profile ]] ; then
    		echo "you have a file named .bash_profile in your home directory"
    	fi
    
  • every if must have a fi
  • man bash will show common tests
  • use == to compare strings and -eq to compare numbers
  • 	if [[ $USER == "harry" ]] ; then
    		echo "Attention $USER, your name is harry"
    	else
    		echo "Attention $USER, your name is not harry"
    	fi
    
    NEXT
    PREVIOUS
    Master Index