![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| eval a variable that has a . | ttshell | Shell Programming and Scripting | 3 | 06-11-2007 11:44 AM |
| using eval w/ echo | wxornot | Shell Programming and Scripting | 2 | 01-17-2006 07:16 AM |
| using eval with set, wc, and expr | wxornot | Shell Programming and Scripting | 2 | 01-08-2006 01:42 PM |
| use of eval n grep | abhi | UNIX for Dummies Questions & Answers | 3 | 02-17-2005 07:38 AM |
| Suse 7.1 Eval (where is it) | amucci | UNIX for Dummies Questions & Answers | 3 | 08-04-2001 03:27 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
How to escape * in string when using eval
Hi
I am implementing array sort of functionality in shell script. I am using a variable1 , variable2 ...... to store temporary values. Now a counter is keeping track of it. For example count=8, variable8="mul * prod". When I try to echo $(variable$count), it replaces * by list of files in current directory. Like : set -x z=9 variable9="kjhgfj * kdufhkjd" Result=`eval echo '$'variable$z` Is their any way by which I can echo value for special case like these where variable has a '*' in it ? Regards, Hanumanth |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
set -f z=9 variable9="kjhgfj * kdufhkjd" Result=`eval echo '$'variable$z` |
|
#3
|
|||
|
|||
|
Thanks
Hi ... thanks for solution ... can you pls let me know wt is the meaning of
set -f |
|
#4
|
||||
|
||||
|
Quote:
|
||||
| Google The UNIX and Linux Forums |