🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4583

Re: Gawk v24.7: Why Bother???

#4583
From: Mark Sheppard
Date: Sat, 29 Apr 1995 00:00
28 lines
2262 bytes
tchrist@mox.perl.com (Tom Christiansen) wrote:
>Of course, if's something awk DOESN'T do, than it's slightly easier to do them
>in perl. :-)
>
>  # find first unused uid after 100, even with perl4
>  perl -le '$i = 100; $i++ while ($x) = getpwuid($i); print $i'

You can do this using gawk:

gawk -F: '{u[$3]=$1;}END{for(i=100;u[i];i++);print(i);}' /etc/passwd

Mark.
--
  \--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\
   \--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\
    m--a--r--k--@--k--i--m--b--l--e--.--m--i--s--t--r--a--l--.--c--o--.--u--k
     \--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\--\
--
=========A=U=T=O=M=A=T=I=C=A=L=L=Y===G=E=N=E=R=A=T=E=D===M=E=S=S=A=G=E=========
Due to Mistral Internet's subdomain hiding we only have one mailbox between
multiple users. This posting is really from mark@kimble.mistral.co.uk. If
you're replying by email you'll have to reply to kimble@mistral.co.uk and do
one of the following:
   1) add an extra header: `X-Really-To: mark'
or 2) put `#mark#' somewhere in the subject
or 3) put `mark' in the first line of the message; this is case insensitive
      so you could, for example, use `Dear Mark,' as the first line.
===============================================================================
Technical Details
Message-ID: <3nsibr$879@kimble.mistral.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3mpj9f$d1h@csnews.cs.colorado.edu> <jerry.798231458@tivoli.com> <3n8qt8$shf@smurf.noris.de> <3nbdqv$cbc@csnews.cs.colorado.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10259a,c6417ab4174dabc8
X-Google-Attributes: gid10259a,public
X-Google-Thread: 1012a6,4df32fd703a6b724
X-Google-Attributes: gid1012a6,public
X-Google-Thread: 1020c6,2f1e554b7912769e
X-Google-Attributes: gid1020c6,public
X-Google-Thread: 1025b4,4df32fd703a6b724
X-Google-Attributes: gid1025b4,public
From: kimble@mistral.co.uk (Mark Sheppard)
Subject: Re: Gawk v24.7: Why Bother???
Date: 1995/04/29
Message-ID: <3nsibr$879@kimble.mistral.co.uk>
X-Deja-AN: 101743624
sender: mark@kimble.mistral.co.uk
references: <3mpj9f$d1h@csnews.cs.colorado.edu> <jerry.798231458@tivoli.com> <3n8qt8$shf@smurf.noris.de> <3nbdqv$cbc@csnews.cs.colorado.edu>
old-nntp-posting-host: kimble.mistral.co.uk
x-really-from: mark
organization: is futile in the face of entropy
newsgroups: comp.unix.shell,gnu.misc.discuss,comp.lang.perl,comp.unix.admin