bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#699: grep in eshell incorrect


From: Ted Zlatanov
Subject: Re: bug#699: grep in eshell incorrect
Date: Tue, 12 Aug 2008 15:18:55 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Tue, 12 Aug 2008 21:54:29 +0300 Eli Zaretskii <eliz@gnu.org> wrote: 

>> Cc: 699@emacsbugs.donarmstrong.com,
>> bug-gnu-emacs@gnu.org
>> From: xah lee <xah@xahlee.org>
>> Date: Tue, 12 Aug 2008 11:40:25 -0700
>> 
>> So, possibly the eshell's "ls" command forming multiple columns is a  
>> bad design. Because after all it is supposed to emulate the unix  
>> shell behavior and "ls | grep xyz" is common idiom.

EZ> Yes, it _is_ supposed to emulate a Unix shell.  But I just tried that
EZ> same pipe both on GNU/Linux and on MS-Windows, and in both cases "ls"
EZ> still forms multiple columns even in a pipe.  So I don't see anything
EZ> wrong with how Eshell's "ls" works.

My tests show different results.  On my Ubuntu system:

% /bin/ls             
Makefile  README.txt

% /bin/ls |/bin/grep M
Makefile
README.txt

% /bin/ls |/bin/grep E
README.txt

So if it's piped (probably /bin/ls tests if the terminal is not
interactive) it acts as if the -1 option is set.  This is how it's
always worked for me, since I often do `ls -t | head -1` to find the
newest file in a directory.

Ted


reply via email to

[Prev in Thread] Current Thread [Next in Thread]