Results 1 to 2 of 2

Thread: Shell variables

  1. #1
    Join Date
    Jan 2004
    Posts
    4

    Unanswered: Shell variables

    I have a question. Im writing a script that will either run x times after a wait of y seconds

    I know positional variable will allow me to get value of x ($1, $2). However, if I want to include the variable name then how
    do I manage that? For example

    Script_name -Run $r -Wait $w

    The user would be allowed to list the variables in any order he/she likes.

    Any suggestions on how to do this?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Shell variables

    Originally posted by J Fitch
    I have a question. Im writing a script that will either run x times after a wait of y seconds

    I know positional variable will allow me to get value of x ($1, $2). However, if I want to include the variable name then how
    do I manage that? For example

    Script_name -Run $r -Wait $w

    The user would be allowed to list the variables in any order he/she likes.

    Any suggestions on how to do this?
    Try getopts.

Posting Permissions

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