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 > Passing arguments within same shell script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-23-09, 01:59
ajitpal.s ajitpal.s is offline
Registered User
 
Join Date: Nov 2008
Posts: 26
Passing arguments within same shell script

Hi,

Is there any way to echieve this. In my shell script i have a procedure

Code:
display_yes()
{
 echo $user
}

Then i call the procedure as below

Code:
user='test'
display_yes
How can i convert my procedure to accept arguments, and then when i call my procedure i can pass the arguments,

any help is very much appreicated
Reply With Quote
  #2 (permalink)  
Old 05-26-09, 01:38
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Same way you pass args to a script
Code:
display_yes()
{
 echo $1 $2 
}
display_yes aaa bbb
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