return value in shell script

How would I tell a script to wait for a return value from a shell script?

Example: instead of using

delay 60

I would rather the script wait until it sees

[admin site1]$

before proceeding.

Thanks!

I’m not sure I understand the question correctly.

By default, ‘do shell script’ pauses your script until the shell command completes.

You have to go out of your way to get control back in your script before the shell command finishes.

Consider:

beep
do shell script "sleep 10"
beep

You should hear a beep, followed by a 10 second pause followed by a second beep, indicating that ‘do shell script’ was waiting for the ‘sleep’ command to finish before continuing your script.

Something like this might work.

set result_ to ""
set result_ to do shell script "do something"
repeat until result_ is not ""
	delay 5
end repeat

– Rob