![]() |
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 |
| create a new environment variable?? | pbsrinivas | UNIX for Dummies Questions & Answers | 1 | 10-22-2007 08:42 AM |
| How do one evaulate a variable's value if it is number or not | suman_jakkula | Shell Programming and Scripting | 1 | 04-20-2007 01:06 AM |
| Create Variable for a PATH | mmignot | Shell Programming and Scripting | 2 | 11-06-2006 03:09 PM |
| How to create md5 Hash variable? | cstovall | Shell Programming and Scripting | 1 | 02-05-2006 07:03 PM |
| Cut a Variable into sub variables based on a delimiter | jingi1234 | UNIX for Dummies Questions & Answers | 6 | 05-06-2005 10:41 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
create variable name based on another variable's value
Hello,
I am needing to create a variable and assign it a value based on the value of a previosly defined variable... I am using KSH.. Example: VAR1=COMPUTER1 I need another variable like ${VAR1}_FLAG="Y", so it would actually be COMPUTER1_FLAG="Y". I will be looping through many values in a while loop and I need to keep track if I have already processed a value already. So my data may look like this: COMPUTER1 COMPUTER2 COMPUTER3 COMPUTER1 COMPUTER3 Initially the value of my second variable I am attempting to create would be N, if it ever gets turned to Y because it hit a specific condition then I need to know that later on after I have looped through the values. I will go through the values again in another while loop to see which ones are Y now so then I would need to do this: If [ ${VAR1}_FLAG = "Y" ] then ... do stuff fi Hope I have explained enough detail... Thanks for any help. |
| Bookmarks |
| Tags |
| bash, bash eval, eval |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|