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

more bash questions




All-

I am tring to get a statement where I request input from the user, and
when a carriage return is entered with no data the script moves to the
next step. So far I have:

while read USER; do
        if [ -n $USER ]; then
                echo $USER >> /tmp/allow.users
        else
                echo "Thank you." 
        fi
done 


But its not ending when I enter a blank line. I think its because the
minute the user enters the first bit a requested data, then $USER is not
null, so the loop will never end. 
I am fairly certain what I want to do is pretty easy, but my first stab is
not quite there. Can someone point out where to take this?

cjm


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