Re: optional exit statment in shell script
- From: "Joachim Schmitz" <nospam.jojo@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Jul 2008 14:09:22 +0200
rudra wrote:
ere is an easier version of what i want to do
#!/bin/bash
echo "Enter file name"
echo "You can enter maximum 3 file"
for (( i=1; i<=3;i++))
until [ "$*" = "" ]
do
echo "Enter file ${i}"
read fil_$i
# check whether read actuylly read something and break if it didn't
[ -z $fil_$i ] && break
# untested...
done
//do the rest of the code
the probleam is, my input needs three input. but what i want to do is
to put an optin of optional break, say instead of three, i have only
one input ...so, if i put "0", the code should ixit for loop and do
the rest of the things.
how can i do that?
Bye, Jojo
.
- Follow-Ups:
- Re: optional exit statment in shell script
- From: Ignoramus20788
- Re: optional exit statment in shell script
- References:
- optional exit statment in shell script
- From: rudra
- optional exit statment in shell script
- Prev by Date: Re: Where is "//"
- Next by Date: Re: For the SEVENTH time, please, what distro for an old computer?
- Previous by thread: optional exit statment in shell script
- Next by thread: Re: optional exit statment in shell script
- Index(es):
Relevant Pages
|