![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using getopts | TurboArkhan | Shell Programming and Scripting | 3 | 06-22-2009 04:31 PM |
| Help in getopts | chella | Shell Programming and Scripting | 4 | 11-02-2007 01:09 AM |
| getopts help | GrepMe | Shell Programming and Scripting | 3 | 06-20-2007 11:47 AM |
| help in getopts | problems | Shell Programming and Scripting | 1 | 05-04-2006 11:07 PM |
| getopts | yerra | Shell Programming and Scripting | 5 | 03-26-2005 10:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
interesting behavior
if I pass the variable in quotes, -k"${KICKOFF}" then getopts will asign the variable inside of my case statement as follows: while getopts p:n:s:d:l do case $opt in k) KICKOFF_PROG=$OPTARG ;; esac done echo "Kickoff Program variable is set to $KICKOFF_PROG" The echo above produces the following result: Kickoff Program variable is set to ${KICKOFF} but.... when I actually use the variable $KICKOFF_PROG it will resolve to the string I passed....interesting behavior. Why doesnt the echo statement expand the variable? |
|
|||||
|
Quote:
If you want to expand a variable inside a variable, you need to use "eval echo". As for your original question, you have multiple variables inside variables and it's not obvious to me when you want them expanded. One intrepretation would suggest that: Kickoff="\"mv $PATH/$FILE1 $PATH/${FILE2}\"" might do the trick. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|