Pooja25 Pooja25 - 1 year ago 84
Bash Question

How to capture the output of one shell script into other in unix

I am running one shell script run_sftp.sh
whose output will be either "done" or "failed"
and I am calling this script into another script which will execute some command if run_sftp.sh output is "done"

If [ Output(run_sftp.sh) = 'done' ] then
echo "run"
"Stop running"

This is the algorithm. Please suggest.

Answer Source

like this?


now you have done/failed in var retval. you can do your if check with your logic.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download