On Mon, 2 Jul 2001, Federico Sevilla III wrote:

> On Mon, 2 Jul 2001 at 15:44, Orlando Andico wrote:
> > GECOS=`cat /etc/passwd | grep $USERNAME | cut -f5 -d:`
> 
> Hey, cool! This is really great (and now I should start reading 'man cut',
> I love this learning gig) but it includes the "other" information (ie:
> office, telephone numbers) which come after the comma. Argh. Hmm...? :)

modify Orly's line:

GECOS=`cat /etc/passwd | grep ^$USERNAME | cut -f5 -d: | cut -f1 -d,`

This only sucks when a user's full name has a comma, like Juniors.

___ eric pareja ([EMAIL PROTECTED]) - "We're all crazy. No one wants to admit it."
\@/ http://gra.ph/~xenos/xenos.pgp | http://plug.linux.org.ph [O/////O]------+
 v  "Even the smallest person can change the course of the future."   / Clue |
      - Lady Galadriel in J.R.R. Tolkien's "The Lord of the Rings"   +-------+

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to