awk and shell question
David Goodenough
dg at lakart.UUCP
Thu Sep 28 05:29:54 AEST 1989
>From article <4926 at macom1.UUCP>, by larry at macom1.UUCP (Larry Taborek):
> try this instead:
>
> USER=`cat /etc/passwd | awk -F: '{printf("%-8.8s %-20.20s\n",$1,$5)}'`
> echo $USER
>
> this works, .....
f::1000:31:Finger Pointer:/:/usr/guest/xfinger
Not on the above it doesn't (think about it).
I suggest:
USER=`cat /etc/passwd | sed -e "s/::/:-:/" | \
awk -F: '{printf("%-8.8s %-20.20s\n",$1,$5)}'`
--
dg at lakart.UUCP - David Goodenough +---+
IHS | +-+-+
....... !harvard!xait!lakart!dg +-+-+ |
AKA: dg%lakart.uucp at xait.xerox.com +---+
More information about the Comp.unix.wizards
mailing list