1834142 Members
2294 Online
110064 Solutions
New Discussion

help in script

 
Jairo Campana
Trusted Contributor

help in script

I need that when finishes the for i in ´cat test´

execute exit of menu:
example
the file test
host1
host2
host3

for i in ´cat test´
do
...
...
case
You continue y/n
y)for in in ´xxx´
...
...
done
n)exit;;
esac
done
legionx
1 REPLY 1
Jairo Campana
Trusted Contributor

Re: help in script

Thanks, I solved my problem using while
FLAG=0
while [ $FLAG -eq 0 ]
DO
for i in ´cat test´
do
...
...
case
You continue y/n
y)for in in ´xxx´
...
...
done
FLAG=1;;
n)exit;;
esac
d
legionx