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

one last...




COPY=/etc/passwd
NEW=~/passwd.new
while read ORIGINAL1; do 
NORM=$(echo $ORIGINAL1 | cut -d ':' -f3); 
        for O in $( cat $NEW | cut -d':' -f3 ) 
        do
                if [ $NORM -ne $O ]; then
                echo $ORIGINAL1 >> $NEW
                fi
        done
done < $COPY 


Okay, the last question here. I think.
My goal here is to get lines from /etc/passwd that do not have a UID that
is already in the $NEW file.
What I have above adds a line each time a UID in $COPY is not match with
each UID being compared from within $NEW. So, each line is added repeated
times, which makes for a large file :)
How can I make it such that the UID being extracted from $COPY is compared
with each UID in $NEW before being added to the $NEW file?

thanks
cjm

ps. without using perl ;)


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