Shell Programming: Introduction



Shell Scripts


Executing Shell Scripts


A Simple Example


Remember Shell Variables?


Using Variables


Some Basic Commands


If Statements


Example If Statement

    if [[ $person = steve ]]
    then
        print $person is on the sixth floor.
    elif [[ $person = todd ]]
    then
	print $person is on the fifth floor.
    elif [[ $person = markus ]]
    then
	print $person is on the fifth floor.
    else
        print "Who are you talking about?"
    fi


While Statements


Case Selection


Sample Case

    case $person in
        steve)
	    print "He's on the sixth floor." ;;
	todd | markus)
	    print "He's on the fifth floor." ;;
	*)
	    print I do not know $person. ;;
    esac


For Loops