Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    26

    Unanswered: 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

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Same way you pass args to a script
    Code:
    display_yes()
    {
     echo $1 $2 
    }
    display_yes aaa bbb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •