Shell programming

Shell programming:

    #    comment
    if (expr) command           foreach var (wordlist)
                                    command(s)
    if (expr) then              end
        command(s)
    endif

    if (expr) then              while (expr)
        command(s)                  command(s)
    else                        end
        command(s)
    endif

    if (expr) then              switch (str)
        command(s)              case pat1:
    else if (expr) then             command(s)
        command(s)              breaksw
    else                        case pat2:
        command(s)                  command(s)
    endif                       breaksw 
                                    ....
                                default:
    label:                          command(s)
    ...                         breaksw
    goto label                  endsw