My shell script stops after exec

后端 未结 3 1836
栀梦
栀梦 2020-11-30 12:54

I\'m writing a shell script that looks like this:

 for i in $ACTIONS_DIR/*
    do
            if [ -x $i ]; then
                    exec $i nap
                     


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 13:42

    exec replaces the shell process. Remove it if you only want to call the command as a subprocess instead.

提交回复
热议问题