Question about backquotes and linux echo

Hi all,

I can’t figure out why the following works from the command line but not
from the backquotes:

echo -e “a\nb\naa” | grep a

This should produce:

a
aa

However, when I execute:

puts echo -e "a\\nb\\naa" | grep a

I get:

-e “a\nb\naa”

Of course, this is a trivial example, but it represents my real problem
well enough. Writing the text to a temp file and using ‘cat’ isn’t an
option, unfortunately.

Thanks for any help,

Brian H.


This email may contain material confidential to
Pearson. If you were not an intended recipient,
please notify the sender and delete all copies.
We may monitor email to and from our network.


Nevermind…it was a Cygwin problem. Works fine on RedHat.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs