csh :t modifier (Was Re: basename(1) (Was Re:argv[0] in shellscript?))

Maarten Litmaath maart at cs.vu.nl
Mon Jun 27 23:53:26 AEST 1988


In article <709 at ubu.warwick.UUCP> maujd at warwick.UUCP (Geoff Rimmer) writes:
\cat /etc/passwd | sed "s/:[^:]*:[^:]*:[^:]*:/	/" | sed "s/[,:].*//" | sort
\					   ^^TAB^^
\---------------------------------------------------------------------
\	(BTW, anyone got any improvements on this 'sed' line?)

How about:

sed 's/:[^:]*:[^:]*:[^:]*:\([^,:]*\).*/	\1/' /etc/passwd | sort
-- 
I'd rather live in Russia             |Maarten Litmaath @ Free U Amsterdam:
              than in South-Africa... |maart at cs.vu.nl, mcvax!botter!ark!maart



More information about the Comp.unix.questions mailing list