You have to be careful about applying bourne-shell syntax explanations to the c-shells. There are many things about them that are very different.
In this case, however, it's correct. The "$0
" positional stores the name of the command, in the form that it was run as (i.e. if you launch the script through a symlink, it will hold the link's name).
, it's treated slightly differently from the rest of the parameters, in that it doesn't appear in the "$@
" lists, or get affected by commands like shift, but in all other respects it's just another parameter.
But parameter use in the c-shell appears to be a bit different, so it may not have quite
the same behavior there. It seems, for example, that csh doesn't have a "$@
" variable, and you have to use "$argv
There's a lot of documentation on the web about csh/tsch syntax. Just google it.
(And read here for several good reasons why you should avoid using it for scripting.)