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 Hartin

···

****************************************************************************
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.

···

-----Original Message-----
From: Hartin, Brian
Sent: Wednesday, April 09, 2008 6:58 PM
To: 'ruby-talk@ruby-lang.org'
Cc: Hartin, Brian
Subject: 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 Hartin
****************************************************************************
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.
****************************************************************************