小编Pet*_*991的帖子

如何阻止zsh脚本被暂停(tty输出)

我有一个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输出问题?

谢谢

linux scripting background zsh

5
推荐指数
1
解决办法
4176
查看次数

标签 统计

background ×1

linux ×1

scripting ×1

zsh ×1