exit from subshell
Hi,
I have wrote one subshell script to use ftp in my env, but I am not able to exit from the subshell loop even I use function exit here, anybody help me to exit from the subshell, I am not sure but if we use array into loop it will exit but how I can use. #!/bin/bash if [ "$#" != "1" ] then echo echo "Usage: $0 <my group> " echo "Example: $0 files " echo exit 1 fi exit() { echo ByeBye break } while : do echo -n "MYFTP> " | tee -a $MYFTP_LOG_FILE read myftp_cmd eval $myftp_cmd 2>&1 | tee -a $MYFTP_LOG_FILE echo done |
I am not sure where your confusion is?
You created an infinite loop with Quote:
|
Yes Grail,
I want to stop looping the subshell when type 'exit' command on subshell promp, so How can I handle the code regarding to exit or stop the looping. |
All times are GMT -5. The time now is 02:13 AM. |