| | |
Simple shell script
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Hi,
I am writing a shell script, and need help with a small piece of code.
It is as below:
I want the output from this as filename, whereas I get it as 1.
Please guide as if where am I going wrong in here.
I am writing a shell script, and need help with a small piece of code.
It is as below:
Shell Scripting Syntax (Toggle Plain Text)
CUST_1=filename b=1 c=$CUST_$b echo $c
I want the output from this as filename, whereas I get it as 1.
Please guide as if where am I going wrong in here.
Learn to appreciate and appreciate to learn.
•
•
Join Date: Aug 2007
Posts: 165
Reputation:
Solved Threads: 18
Weird, but it can be done.
There may be easier ways to do what you mean, like using an array. But this works, and gets points for being 'clever'.
Shell Scripting Syntax (Toggle Plain Text)
CUST_1=filename b=1 eval c=\$CUST_$b echo $c
There may be easier ways to do what you mean, like using an array. But this works, and gets points for being 'clever'.
![]() |
Similar Threads
- Call a shell script from a python script (Python)
- Simple Shell Script Question.... [java related] (Shell Scripting)
- shell script help (Shell Scripting)
- Need help in Shell script (Shell Scripting)
- A simple perl script (Perl)
- simple shell script....complex migraine (Shell Scripting)
- Problem with variables in Windows shell script (Windows NT / 2000 / XP)
- Shell Script for Gnome 2.6 Print Manager. (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: Piping to "open command"
- Next Thread: ZIP Script modified - Help
| Thread Tools | Search this Thread |





