我有一个zsh脚本,我想运行它,它也加载我的.zshrc文件.我相信我必须以交互模式运行我的脚本?
因此,我的脚本开始如下:
#!/bin/zsh -i
if [ $# = 0 ]
then
echo "need command line paramter..."
exit
fi
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试在后台运行此脚本时,我的脚本将被暂停(即使我传入了正确数量的参数):
[1] + suspended (tty output)
Run Code Online (Sandbox Code Playgroud)
我的问题是:如何制作一个可以在后台运行的脚本,它还会加载我的启动.zshrc文件?如果我必须将其置于交互模式,我怎样才能避免暂停tty输出问题?
谢谢