# Question about backquotes and linux echo

**URL:** <https://www.ruby-forum.com/t/question-about-backquotes-and-linux-echo/134352>\
**Category:** Ruby\
**Created:** [April 10, 2008, 1:58am UTC](https://www.ruby-forum.com/t/question-about-backquotes-and-linux-echo/134352 "2008-04-10T01:58:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a587f6/32.png) [@kuma](https://www.ruby-forum.com/u/kuma)\
**Post date:** [April 10, 2008, 1:58am UTC](https://www.ruby-forum.com/t/question-about-backquotes-and-linux-echo/134352/1 "2008-04-10T01:58:15Z")

</div>

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.

* * *

---

<div class="post-metadata">

**Author:** ![kuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a587f6/32.png) [@kuma](https://www.ruby-forum.com/u/kuma)\
**Post date:** [April 10, 2008, 2:09am UTC](https://www.ruby-forum.com/t/question-about-backquotes-and-linux-echo/134352/2 "2008-04-10T02:09:21Z")

</div>

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