Edmond Rodriguez on 16 Sep 2010 18:34:14 -0700 |
On Thu, Sep 16, 2010 at 7:40 PM, sean finney <seanius@seanius.net> wrote: >> Would escaping the $'s provide a possible simple solution to a not too >> complex line, if they were serving only as variable holders and did >> not need to be resolved before the eval? > > in that case you wouldn't need eval. > > eval foo \$bar > > is the same as plain ol' > > foo $bar The original poster had pipes he was dealing with, and to execute that string, you would need eval. If there was a var that possibly could have a quote or something in it, couldn't it be escaped so as to produce the intended result? eval "foo \$bar | foo2" This looks the same as just foo $bar | foo2, but if it's in a variable (like the poster was doing) with a string that needs to be parsed then..... SOMEVAR="foo \$bar | foo2" eval "$SOMEVAR" ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|