Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

problem with script

Go to solution
Henry Chua
Super Advisor

problem with script

Hi Guys,

I have a queries with scripting:


set a=$1
set b=$2
set c=$3

May I know what does this use of $ sign represent?

Best regards

Sergejs Svitnevs
Honored Contributor

Re: problem with script

There are the parameters from the command line.
For example, if you have a script named 'foo', and you want to give it two
parameters, 'X1' and 'X2'. You would type this command:
foo X1 X2

Within the script, '$1' will return the first parameter 'X1', and '$2' will
return the second parameter 'X2'. '$0' returns the command name, 'foo'.

#!/bin/csh -f
echo 'Command:' $0
echo 'Parameters:' $1 $2

Henry Chua
Super Advisor

Re: problem with script

thanks Sergejs, right on..