![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| EVal | Khoomfire | Shell Programming and Scripting | 1 | 11-24-2008 08:05 AM |
| eval a variable that has a . | ttshell | Shell Programming and Scripting | 3 | 06-11-2007 03:44 PM |
| using eval w/ echo | wxornot | Shell Programming and Scripting | 2 | 01-17-2006 10:16 AM |
| using eval with set, wc, and expr | wxornot | Shell Programming and Scripting | 2 | 01-08-2006 04:42 PM |
| Suse 7.1 Eval (where is it) | amucci | UNIX for Dummies Questions & Answers | 3 | 08-04-2001 07:27 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
eval misconception
Hi, I have two files "foo" and "bar" Code:
$ cat foo a is \$a and b is \$b Code:
$ cat bar car tree using the below 'while' loop I expect the output to be: a is car and b is tree Code:
while read a b; do
eval echo $(cat foo) # o/p: a is $a and b is $b
eval "echo $(eval "cat foo")" # o/p: a is $a and b is $b
done < bar
rather getting the one which I mentioned as 'o/p'. I am not very sure about eval, how it works, so pls explain and correct me where I have gone wrong. Last edited by royalibrahim; 12-02-2008 at 05:23 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|