[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
more bash questions
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
echo "Thank you."
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?
To unsubscribe, send email to email@example.com with
"unsubscribe luci-discuss" in the body.