13

double variable substitution

view full story
linux-howto

http://www.unix.com – Code: $ ABCel='[email protected]' $ XYZel='[email protected]' $ MYel='[email protected]' $ echo $ABCel [email protected] $ echo $XYZel [email protected] $ echo $MYel [email protected] I tried 3 variations, but not getting the expected result: Code: $ for VAR in ABC XYZ; do echo -e "${VAR}el $MYel"; done ABCel [email protected] XYZel [email protected] Code: $ for VAR in ABC XYZ; do MAIL=${VAR}el; echo -e "$MAIL $MYel"; done ABCel [email protected] XYZel [email protected] Code: $ for VAR in ABC XYZ; do MAIL=${VAR}el; echo -e "${MAIL} $MYel"; done ABCel [email protected] (HowTos)