On Mon, Aug 16, 1999 at 11:47:38AM +0300, Geoffrey S. Mendelson wrote:

> Any easy way to create the file would be 
> 
>       cat /etc/passwd | awk -F: '($2 > 100) {print $1}' >/etc/allusers
> 
> This will ignore root, bin, etc.

Join the Useless Use of cat Crazies! Rewrite that as

        awk -F: '($3 > 100) {print $1}' < /etc/passwd > /etc/allusers

(note field #2 is the password)

Err. Waitaminute!!! I'm supposed be advocating Perl:

        perl -lne '/^(.*?):.*?:(\d+)/&&$2>100&&print$1' /etc/passwd
                > /etc/allusers

Darn. Longer :-|

Well, as Larry Wall put it, "AWK has to be better for something :-)"

-- 
believing is seeing
[EMAIL PROTECTED]
http://www.forum2.org/gaal/

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to