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
Is it possible to pass variable from awk to shell script user_prady Shell Programming and Scripting 3 12-18-2007 06:06 AM
passing parameter from Shell-script to Sql-script subodhbansal Shell Programming and Scripting 0 09-21-2007 03:15 AM
How to pass Shell script variable to awk HIMANI UNIX for Dummies Questions & Answers 3 07-15-2007 09:23 PM
How to Pass variable to shell Script sam70 UNIX for Dummies Questions & Answers 5 08-23-2005 04:27 PM
simple shell - how to get a parameter typed in a shell script cmitulescu Shell Programming and Scripting 3 12-05-2001 11:04 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-21-2007
Registered User
 

Join Date: Sep 2007
Posts: 2
Smile How to pass a parameter from one Shell-script to another Shell-script

Dear Friends,

Please help me.
How can I pass a parameter from one Shell-script to another Shell-script.
Example:

FirstScript.sh
-------------
./SecondScript.sh 'paramater'

And

SecondScript.sh
---------------
doing something with passed parameter from FirstScript.sh


Please help me as I am new to scripting stuff.

Regards,
Subodh
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-21-2007
Registered User
 

Join Date: Sep 2006
Posts: 1,434
use $1 in your second script to get the parameter.
Reply With Quote
  #3 (permalink)  
Old 09-22-2007
manas_ranjan's Avatar
Registered User
 

Join Date: Jul 2007
Location: PUNE
Posts: 157
try out the following one , as mentioned by ghostdog,

content of SecondScript.sh
var1=$1


and content of FirstScript.sh ,
./SecondScript.sh "parameter"
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:57 AM.


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