On Sat, Sep 29, 2001 at 11:54:51PM -0400, Joey Hess wrote: > Ben Hartshorne wrote: > > uid=`echo $i | sed -e "s/[^:]*:[^:]*:\([^:]*\).*/\1/"` > > > Someone make me feel embarassed by posting a much more beautiful script. > > At the very least, replace those sed lines with awk or something. It > > should be much easier to say "grab the first and third field split by > > :'s" than that ugly regexps above. > > cut -d : -f 1,3 And of course awk -F: '{printf("%s:%s\n",$1,$3)}' but I like Joey's cut command better. -- Nathan Norman - Staff Engineer | A good plan today is better Micromuse Ltd. | than a perfect plan tomorrow. mailto:nnorman@micromuse.com | -- Patton
Attachment:
pgp1432h9aq5n.pgp
Description: PGP signature