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

Re: [SLUG] Script needed



If you're going to use perl:

perl -F: -anle 'print $F[0]' </etc/passwd

but I like the cut solution best.

On Thu, 1 Jun 2000, Adam Kennedy wrote:

> perl -e 'print grep { s/^(\w+)\:.*$/$1/; 1; } <>' < inputfile > outputfile
> 
> What I of course SHOULD be saying is RTFM
> 
> Adam
> ----- Original Message -----
> From: Simon Bryan <sbryan@nospam.olmc.nsw.edu.au>
> To: <slug@nospam.slug.org.au>
> Sent: Thursday, 1 June 2000 2:07 PM
> Subject: [SLUG] Script needed
> 
> 
> > Hi,
> > I am looking for some kind script wizard to help me out.
> > I have a file of:
> > username:password
> >
> > I want to be able to regularly generate a file from this of just the
> usernames,
> > that is strip off the ':password'. Could some kind person pointme at the
> Perl
> > (or other commands) to do this?
> >
> > Cheers,
> >
> >
> > --
> > Simon Bryan                    sbryan@nospam.olmc.nsw.edu.au
> > Information Technology Manager sbryan@nospam.mpx.com.au
> > OLMC Parramatta
> > --
> > SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
> > To unsubscribe send email to slug-request@nospam.slug.org.au with
> > unsubscribe in the text
> >
> 
> --
> SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
> To unsubscribe send email to slug-request@nospam.slug.org.au with
> unsubscribe in the text
> 

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text