我的 .bashrc 中有这些功能:
# This function just untar a file:
untar()
{
tar xvf $1
}
# This function execute a command with nohup (you can leave the terminal) and nice for a low priority on the cpu:
nn()
{
nohup nice -n 15 "$@" &
}
在测试 nn 函数之前,我创建了一个 tar:
echo test > test.txt
tar cvf test.txt.tar test.txt
现在我想做的是:
nn untar test.txt.tar
但只有这个有效:
nn tar xvf test.txt.tar
这里 nohup.out 中的错误:
nice: ‘untar’: No such file or directory