shell脚本中使用nohup执行命令不生效

it2022-05-05  79

1 例如

!#/bin/bash nohup echo "hello world"

  

 

2 解决办法

加上 source /etc/profile 就好了

!#/bin/bash source /etc/profile nohup echo "hello world"

  

3 原因

  找不到环境变量,所以先source一下

 

转载于:https://www.cnblogs.com/QuestionsZhang/p/11178825.html


最新回复(0)