Using shell script PARAMETERS
Parameters from the command line can be used within a C-shell script by using
the pseudo-variables '$0', '$1', '$2', etc.
For example, if you have a script named 'foo', and you want to give it two
parameters, 'bar1' and 'bar2'. You would type this command:
foo bar1 bar2
Within the script, '$1' will return the first parameter 'bar1', and '$2' will
return the second parameter 'bar2'. '$0' returns the command name, 'foo'.
So, if the script foo contained these lines:
#!/bin/csh -f
echo 'Command:' $0
echo 'Parameters:' $1 $2
...then the above command would produce the following output:
Command: foo
Parameters: bar1 bar2
To learn more about shell programming, you can read the manual page for 'csh'
by using the 'man' command:
man csh
|