ksh-Script

"Gliebe Richard [riglEDV.at]" <[email protected]>
Newsgroups gmane.linux.redhat.general.german
Organization riglEDV
Message-ID <[email protected]>
Hallo zusammen,

ich bastle gerade ein Script in dem folgende Abfrage
rein muss:

[...]
#!/bin/ksh
echo "\tDo you want to continue ? <y/n> \c"
read answer
if [ $answer != y ]
   then
     echo "exiting......"
     echo "... type ENTER ..."
     read a
     exit 1
   else
     echo
     echo "Going on ..."
     echo
fi
[...]

d.h. NUR wenn mit "y" beantwortet wird, darf das Script weiterlaufen.
Soweit so Gut.
ABER: fällt man mit dem Kopf so um 3 Uhr in der Früh auf die "ENTER" 
Taste, kommt folgende Meldung, und das Script geht zum nächsten Step:

[...]
         Do you want to continue ? <y/n>
./xx[12]: test: argument expected

Going on ...
[...]

Weiss jemand wie man das Unterbinden kann (eventuell mit "trap",...) ?

Danke
Richard

-- 
riglEDV
Richard Gliebe
Consulting | Support | Internet
A-6922 Wolfurt
mailto:[email protected]
http://www.rigledv.at
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.