next up previous contents index
Next: C shell programming Up: C-Shell summary Previous: quoting

shell variables

    $var        value of var
    ${var}      value of var, insulate var string
    $var[i]     value of 1th word in var wordlist
    $var[*]     same as $var
    ${var}[i]   value of 1th word in var wordlist, insulate var string
    $#var       number of words in wordlist
    $i          same as $argv[i] (i now restricted to 1-9!!!)
    $*          same as $argv[*]
    $var[n-m]   words n through m from var wordlist, though n and m can
                both be absent and default to 1 and $#var resp.

    $0          name of scriptfile
    $?var       1 if var defined, 0 if not
    $$          process ID of parent shell
    $<          substitute line from stdin (interactive input)

Peter Teuben