On Wed, Feb 13, 2013 at 04:55:01PM +0000, Adam Dinwoodie wrote:
>Jack Radigan wrote:
>> Using the following script:
>> #!/bin/bash
>> set -x
>> cat << eof | `ls /bin | grep "^grep$"` alpha
>> alpha
>> omega
>> eof
>
>Easier repro showing this phenomena:
>
>    ls /bin | grep '^grep$'
>
>On Linux, you'll get "grep" as output.  Cygwin won't output anything.

Yep, but if you want to write code that will work on both *nix and
Cygwin you could do this:

ls /bin | sed -n -e 's/\.exe$//' -e '/grep/p'

That works on both Cygwin and Linux.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to