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

Re: one last...




thanks!

charles - who does not play the fiddle, nor plans on ever owning one.


On Sun, 6 Feb 2000, Jay Link wrote:

> 
> 
> > My goal here is to get lines from /etc/passwd that do not have a UID that
> > is already in the $NEW file.
> 
> Can you chill out for a while, now? I'm trying to get some work done.  :)
> 
> 
> #!/bin/bash
> 
> OLD="/etc/passwd"
> NEW="~/passwd.new"
> 
> while read LINE1; do
>    ID1=$(echo $LINE1 | cut -d':' -f3)
>    FLAG=0
>    while read LINE2; do
>       ID2=$(echo $LINE2 | cut -d':' -f3)
>       if [ $ID1 = $ID2 ]; then
>          FLAG=1
>       fi
>    done < $NEW
>    if [ $FLAG -eq 0 ]; then
>       echo $LINE1 >> $NEW
>    fi
> done < $OLD
> 
> 
> --
> To unsubscribe, send email to majordomo@luci.org with
> "unsubscribe luci-discuss" in the body.
> 


--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.