![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parameter problem in my script | Laibro | Shell Programming and Scripting | 11 | 06-02-2008 11:51 AM |
| Pass parameter into script | alfredo | Shell Programming and Scripting | 2 | 04-08-2008 06:40 PM |
| passing parameter from Shell-script to Sql-script | subodhbansal | Shell Programming and Scripting | 0 | 09-21-2007 03:15 AM |
| Using last parameter within a script? | sugarat | Shell Programming and Scripting | 3 | 03-09-2004 03:35 AM |
| Pass Parameter to Another Script | rvprod | UNIX for Dummies Questions & Answers | 4 | 04-05-2002 09:07 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Parameter to script
Can i pass more than 9 parameters to unix shell script
if yes in script how can I get that parameter z=${10} WILL ABOVE STATEMENT GIVES ME VALUE FOR 10TH PARAMETER PASSED |
| Forum Sponsor | ||
|
|
|
|||
|
hi ,
we can supply as many parameters to a script. simplest way is : PHP Code:
PHP Code:
Sumeet |
|
|||
|
The above only works depending on your ksh version.
What always should work is using the "shiift" command. # cat ff.sh #!/usr/bin/ksh echo $1 echo $2 echo $3 echo $4 echo $5 echo $6 echo $7 echo $8 echo $9 shift 9 echo $1 echo $2 echo $3 echo $4 echo $5 echo $6 # ./ff.sh a b c d e f g h i j k l m n o p a b c d e f g h i j k l m n o I provided an extra argument ("p") on purpose. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|