X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Subject: RE: grep and exact matches help..
Date: Tue, 3 Apr 2007 17:20:00 -0500
Message-ID: <297343D29C14AA4D822142893ABEAEF302F44AC1@srv1163ex1.flightsafety.com>
In-Reply-To: <20070403220528.GA12449@suncomp1.spk.agilent.com>
From: "Thrall, Bryan" <bryan.thrall@flightsafety.com>
To: <cygwin@cygwin.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l33MKFGv005423

Gary Johnson wrote on Tuesday, April 03, 2007 5:05 PM:
> On 2007-04-03, Dave Korn wrote:
> 
>>   BTW2, I assume we're still talking about your script from before.
>> Seriously, use "ls -1" rather than "ls -l" (that is, use a one
>> instead of an L), because then you get /just/ the filenames, one per
>> line, and won't have to worry about parsing the name out from
>> amongst all those permission flags and datestamps.
> 
> On 2007-04-03, Peter Rehley wrote:
> 
>> Here is one possible solution
>> 
>> ls -1a | grep winops | grep -v winops-hp
>> 
>> or maybe this
>> 
>> ls -1a | sed -e '/winops-hq/d'
> 
> If you're piping 'ls' into another command, the -1 isn't necessary.
> 'ls' detects that its stdout is not a tty and delivers single-column
> output automatically.

Not when you use 'ls -l':

thrall@PC1163-8413-XP /tmp/thrall/foo
$ ls | cat
bar
baz
thrall@PC1163-8413-XP /tmp/thrall/foo
$ ls -l | cat
total 0
-rw-r--r--  1 thrall FSUsers 0 Apr  3 17:19 bar
-rw-r--r--  1 thrall FSUsers 0 Apr  3 17:19 baz
thrall@PC1163-8413-XP /tmp/thrall/foo
$ ls -1 | cat
bar
baz

-- 
Bryan Thrall
FlightSafety International
Bryan.Thrall@flightsafety.com

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


