If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > pass parameters to a shell script...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-04, 21:15
debkumar debkumar is offline
Registered User
 
Join Date: May 2002
Posts: 28
pass parameters to a shell script...

Hi,
If the parameters passed to a shell script are more than 9, then how to handle it...

Thanks
Deb
Reply With Quote
  #2 (permalink)  
Old 03-18-04, 01:42
pooja pooja is offline
Registered User
 
Join Date: Dec 2002
Posts: 104
Re: pass parameters to a shell script...

Quote:
Originally posted by debkumar
Hi,
If the parameters passed to a shell script are more than 9, then how to handle it...

Thanks
Deb
hi,

U can use "shift" command

hope this will solve ur problem

--cheers,
Pooja
Reply With Quote
  #3 (permalink)  
Old 03-18-04, 04:04
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
Use the ${i} syntax for parameters substitution
For example : ${11}

The following script display all the parameters (bash syntax for loop):
Code:
echo "Args#: $#"
for ((a=1; a<=$#; a++))
do
   eval arg=\${$a}
   echo "Args$a: $arg"
done
__________________
Jean-Pierre.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On