BladeSystem Forums have moved here
To make BladeSystem information easier to find, we have moved the BladeSystem forums here, to Servers and Operating Systems.
Showing results for 
Search instead for 
Do you mean 

problem with script

SOLVED
Go to Solution
Highlighted
Super Advisor

problem with script

Hi Guys,

I have a queries with scripting:

!#/usr/bin/csh

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

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

Best regards
Henry


2 REPLIES
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

Regards,
Sergejs
Super Advisor

Re: problem with script

thanks Sergejs, right on..