The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how can i pass parameter with spaces to csh script umen Shell Programming and Scripting 1 03-19-2008 08:33 AM
How to pass a parameter from one Shell-script to another Shell-script subodhbansal Shell Programming and Scripting 2 09-22-2007 02:19 AM
PASS parameter to AWK unisam UNIX for Dummies Questions & Answers 2 05-14-2004 06:51 AM
Pass Parameter to Another Script rvprod UNIX for Dummies Questions & Answers 4 04-05-2002 09:07 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-08-2008
Registered User
 

Join Date: Jan 2008
Posts: 17
Pass parameter into script

I would like to write a scirpt a.sh that it first checks the first parameter of the input. If it fulfill some condition ,then run an executable program b by using all the parameter.

ie.
> ./a.sh 10 20 30 40 50
Then a.sh first checks the first parameter, 10, if it mathes the requirement, then a will call program b to run
> b 10 20 30 40 50

I do not know how many parameter will be passwd into b. Therefore, I cannot use $1, $2......

Is there any solution?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-08-2008
Registered User
 

Join Date: Nov 2007
Location: Pune
Posts: 19
Use $* and pass all the parameters to b
Reply With Quote
  #3 (permalink)  
Old 04-08-2008
Registered User
 

Join Date: Jan 2008
Posts: 17
Thank you very much!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0