我试图nohup像这样调用一个函数:
function1(){
while true
do
echo "function1"
sleep 1
done
}
nohup function1 &
# ...... some other code
Run Code Online (Sandbox Code Playgroud)
但可能是看不到的功能nohup,我得到这个错误:
nohup: failed to run command `function1' : No such file or dictionary
Run Code Online (Sandbox Code Playgroud)
我不想为我的函数创建新的sh文件.我怎样才能解决这个问题?