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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
simple shell - how to get a parameter typed in a shell script cmitulescu Shell Programming and Scripting 4 01-09-2009 08:45 PM
Is it possible to pass variable from awk to shell script user_prady Shell Programming and Scripting 3 12-18-2007 10:06 AM
passing parameter from Shell-script to Sql-script subodhbansal Shell Programming and Scripting 0 09-21-2007 07:15 AM
How to pass Shell script variable to awk HIMANI UNIX for Dummies Questions & Answers 3 07-16-2007 01:23 AM
How to Pass variable to shell Script sam70 UNIX for Dummies Questions & Answers 5 08-23-2005 08:27 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-21-2007
subodhbansal subodhbansal is offline
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
  #2 (permalink)  
Old 09-21-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

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

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

content of SecondScript.sh
var1=$1


and content of FirstScript.sh ,
./SecondScript.sh "parameter"
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0