in reply to Eval Function Question

a) you didn't backwhack the second dollar sign ($1) so you it's not getting passed through to be seen by eval; 2) this is possibly a simplified example, but you really don't need to use eval to do this; III) the /e modifier (or some number of them) may do what you think you need to use an eval of the entire statement for.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: Eval Function Question
by brwarn (Novice) on Nov 04, 2009 at 20:28 UTC
    Thank you both for your answers. The second backwhack takes care of the problem. I'm sure we tried that in one of our iterations of the script. Oh well, it works now.
    -Brian

      By the way, you probably should not be doing it at all. eval has teeth: $strvar = "test text \@{[ `rm -rf /' ]) # sic"; for contrived example. There is almost guaranteed to be a better/safer way to do whatever you want. Check what Fletch said about the e flag to start with. If that doesn't cover your needs, probably should ask about the problem you're trying to solve and not just the code that won't work.