Ive got a problem with menu sub commands

Ive got a problem fron a menu script where:

If i choose option 1 it will run a command for instance

option 1 will run another script that will grep for a certain process name also using the If command. IE if chicken process is present echo cluck cluck, but if no chicken then echo no eggs !!!

How would i re-route the end message from the other script back to echo in the main script menu window ?

Hope someone can help

Many Thanks

Wmccull

can you post your script so someone can help you.

Script is below

choice=0

while [ $choice -ne 10 ]
do
clear

echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo""
echo " #"
echo " # #"
echo " # CCcam Menu #"
echo " # #"
echo " # #"
echo " # 1) Install CCcam #"
echo " # #"
echo " # 2) Remove CCcam #"
echo " # #"
echo " # 3) Backup CCcam #"
echo " # #"
echo " # 4) Mail CCcam.CFG #"
echo " # #"
echo " # 5) Stop CCcam #"
echo " # #"
echo " # 6) Start CCcam #"
echo " # #"
echo " # 7) Restart CCcam #"
echo " # #"
echo " # 8) Setup CCcam monitoring #"
echo " # #"
echo " # 9) Go BACK == >> #"
echo " # #"
echo " # 10) Exit #"
echo " ############################################### "

echo ""
echo -n " choice: "
read choice

case "$choice" in

1) df;;

2) ./script2;;

7) ./ CCcam_restart.sh;;
esac

i on my 7) choice, the script will restart Application CCcam but if it finished with success being the it restarted correctly , it should echo " Cccam restart successfully " to screen.

Hope this will help..

Many Thanks

Wmccull

You may want to add something like this to choice 7:

...
case "$choice" in
...
...
  7) ./CCcam_restart.sh
     retval=$?
     if [ "$retval" -eq "0" ] ; then
       echo "CCcam restarted successfully"
     fi;;
...
esac
...

tyler_durden

Ah yes, worked a treat. Thanks very much