0
set a = 3
set type = a
echo $($type)

How for me to get value of 3 from variable $type which is a. I can't get value 3 from what i do above? please help thanks!

Edited by happy8899: n/a

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by IIM
0
a = 3
b = 2
c = 5
d = 1

foreach type(a b c d)
if(step == $$type) then
echo "the value is 3"
endif
end

my problem is something like this, how for me to get the value 3 from the variable type, i cannot assign a b c d in type as a variable, it is a value

Edited by happy8899: n/a

0

Sorry never really used that particular shell app. Try asking again and including that information and someone better qualified may have a better idea.

0

this code is for unix shell scripting....you better check if this works for WScript or not....

set valu=3
a = 3
b = 2
c = 5
d = 1
 
for valu in $a $b $c $d
if [ step = $valu ] then
echo "the value is 3"
fi
done

Edited by IIM: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.