Reputation: 63
seven="( . 1 . 1 . 1)"
octal="zero one two three four five six seven"
for n in $octal
do
echo $n
done
When this gets to seven it echos "seven". How do you get it to echo ( . 1 . 1 . 1)
which is the string for $seven
?
Upvotes: 0
Views: 1175
Reputation: 799170
seven="( . 1 . 1 . 1)"
octal="zero one two three four five six seven"
for n in $octal
do
echo "${!n:-$n}"
done
Upvotes: 4