bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: About gawk! Is this a bug???


From: albertus
Subject: Re: About gawk! Is this a bug???
Date: Thu, 21 Mar 2002 20:13:05 +0900
User-agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.8) Gecko/20020204

º£Ìì wrote:
Hi,

  I am sorry to trouble you, i have a question!
  Just look that the things below:

--------------------------------------------------
address@hidden cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/adm:
lp:x:4:7:lp:/var/spool/lpd:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:
news:x:9:13:news:/var/spool/news:
uucp:x:10:14:uucp:/var/spool/uucp:
operator:x:11:0:operator:/root:
games:x:12:100:games:/usr/games:
gopher:x:13:30:gopher:/usr/lib/gopher-data:
ftp:x:14:50:FTP User:/home/ftp:

address@hidden gawk '{FS="/"};{print $NF}' /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:
sbin:
adm:
lpd:
sync
shutdown
halt
mail:
news:
uucp:
root:
games:
gopher-data:
ftp:

address@hidden gawk --version
GNU Awk 3.0.4
Copyright (C) 1989, 1991-1999 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
----------------------------------------------------

  Why the first line of the file "/etc/passwd" is still 
"root:x:0:0:root:/root:/bin/bash" ?
  Is it a bug of ver3.0.4 OR just my falt? What can I do about this? Please 
help me! Thank U very much! (^o^)
Wed Mar 20 2002

______________________________________

===================================================================
ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
ÐÂÀË·ÖÀàÐÅÏ¢£º¶þÊÖÊг¡×ßÒ»×ߣ¬¸Ã³öÊÖʱ¾Í³öÊÖ£¡ 
(http://classad.sina.com.cn/2shou/)



This should work(untested;)):

  gawk 'BEGIN{FS="/"} {print $NF}' /etc/passwd


albertus;)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]