Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    28

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

  2. #2
    Join Date
    Dec 2002
    Posts
    104

    Re: pass parameters to a shell script...

    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

  3. #3
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    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.

Posting Permissions

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