![]() |
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 |
| loop through variable | finalight | Shell Programming and Scripting | 0 | 05-20-2008 10:30 PM |
| find command in while loop - how to get control when no files found? | mavsman | Shell Programming and Scripting | 3 | 04-03-2008 11:44 AM |
| getting values from variable in a loop | kriuz | Shell Programming and Scripting | 3 | 01-22-2008 05:50 PM |
| pass a variable to sed p in a loop? | JohnMario | Shell Programming and Scripting | 7 | 01-02-2008 05:13 PM |
| variable in a for loop | sars | Shell Programming and Scripting | 3 | 11-28-2006 05:59 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
variable not found with loop?
I cannot seem to pass the value of the variable assigned in the "else" statment below to an "if" statement outside of the loop. When I debug using "set -x", I find that the value of "$A" is empty. Is there something I'm missing here? Code is below:
Code:
do
if [[ "$var1" = "L" && "$var2" = "e" ]] then
echo "Good Match" $var1
elif [[ "$var1" = "T" && "$var2" = "t" ]] then
echo "Good Match" $var1
elif [[ "$var1" = "P" && "$var2" = "c" ]] then
echo "Good Match" $var1
else
echo "No Match"
A = "N"
fi
done
if [[ $A = "N" ]] then
exit
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|