Operating System - Linux
1748022 Members
4676 Online
108757 Solutions
New Discussion юеВ

Re: question on scripting

 
SOLVED
Go to solution
Mark Harshman_1
Regular Advisor

Re: question on scripting

ok, the re-direct worked good, thanks. Now i have one more issue. If the answer is "n", i want to throw it back to my "cat-while-read" statement, if the answer is "y", i want to do a couple things before going back to the the "cat-while-read" statement. I obviously have this wrong cause its falling all the way thru. Thanks for your patience with a rookie scripter.
Never underestimate the power of stupid people in large groups
James R. Ferguson
Acclaimed Contributor

Re: question on scripting

Hi Mark:

For loops you can 'break' or 'continue'.

A 'break' terminates the loop. A 'continue' will cause control to begin again at the top of the loop.

The manpages for 'sh-posix' are quite useful:

http://docs.hp.com/en/B2355-60127/sh-posix.1.html

Regards!

...JRF...
Rodney Hills
Honored Contributor

Re: question on scripting

With out seeing that section of code, it's hard to understand where you are coming from.

If the "read" is in the while-loop, then just follow with a structured if-

read REPLY if [[ "$REPLY" = "y" ]] ; then
echo "answer was y"
fi

HTH

-- Rod Hills
There be dragons...