The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
passing a variable inside a variable to a function
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
passing a variable inside a variable to a function
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
01-14-2008
gus2000
Registered User
Join Date: Oct 2007
Posts: 155
Ah, you want the shell to parse "$C$x" as "$C1" but instead it is doing "$C" + "$x". So, you need to force it to evaluate $x first.
Code:
# C1=abc # x=1 # echo $C$x 1 # eval echo \$C$x abc
Is that what you were looking for?
gus2000
View Public Profile
Find all posts by gus2000