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 to get files names passed to a script unishiva Shell Programming and Scripting 5 11-08-2007 12:01 AM
Problem with script not able to take parameters passed to it dsravan Shell Programming and Scripting 7 10-09-2007 06:28 PM
checking parameter values passed to script ammu UNIX for Dummies Questions & Answers 2 10-05-2007 09:35 AM
Extracting passed in parameters spookyrtd99 Shell Programming and Scripting 2 05-22-2007 07:07 PM
Assigning a Variable all the Parameters passed samit_9999 UNIX for Dummies Questions & Answers 2 12-04-2006 01:21 PM

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

Join Date: Jul 2006
Posts: 180
Problem with script not able to take parameters passed to it

Quote:
export NUM_OF_MKTS=$1
export subj=$2

if [ $2 = 'sub' ]; then
export RUNDTFILE=et_run_sts.txt
export TBLNAME=sub_audt
elif [ $2 = 'acct' ]; then
export RUNDTFILE=con_et_run_sts.txt
export TBLNAME=acct_audt
fi
Quote:
run time paramters: concat_files.ksh 1 act
debug output:

Quote:
+ export NUM_OF_MKTS=x
+ export subj=
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-28-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,465
should the parameters be - 1 acct - not 1 act
Reply With Quote
  #3 (permalink)  
Old 02-28-2008
Registered User
 

Join Date: Jul 2006
Posts: 180
it should be
Quote:
1 acct
but still the same problem.
Reply With Quote
  #4 (permalink)  
Old 02-28-2008
Registered User
 

Join Date: Jul 2007
Posts: 93
When I run it, I'm getting the variables set without any issues.

I put at bottom of script, and it looks to be working as expected.
Code:
print $NUM_OF_MKTS $subj
print $RUNDTFILE $TBLNAME
curious why you're setting "export subj=$2" and then not using it??
you could change your if statement to "if [ $subj = 'sub' ]"
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:07 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