Re: ** OT : awk works only for first line

From: Jared Still <jkstill_at_gmail.com>
Date: Wed, 28 Jan 2009 11:30:43 -0800
Message-ID: <bf46380901281130v5ad48297u759d6c00560daf8e_at_mail.gmail.com>



What was I thinking?

Brain was in loop mode.

 cut -f1 -d: < emplis.txt

On 1/28/09, Jared Still <jkstill_at_gmail.com> wrote:
> I think what you may be missing is that awk is a processing language that
> is designed to handle whatever it gets from STDIN.
>
> There's no need really to use it in a loop as you have done.
>
> Mark has already shown how to do use awk.
>
> Another tool you may be interested in is cut.
>
> while read emp
> do
> echo $emp | cut -f1 -d:
> done < emplis.txt
>
> john_ray
> joe_smith
> bill_bates
> jane_de
>
>
> For some humorous surfing, google for 'useless use of cat'. :)
>
> Jared
>

-- 
Sent from Gmail for mobile | mobile.google.com

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jan 28 2009 - 13:30:43 CST

Original text of this message