next up previous contents index
Next: C-Shell meta characters Up: C-Shell summary Previous: shell variables

C 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



Peter Teuben
9/29/2000