开始使用source ./filename.sh时是正常的,因为sh脚本中只包含了一个cd,但当多个cd时第二个cd命令就不起作用了

后然在sh中加上以下语句就可以了

PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

解答者xiehuahere的解释是(https://zhidao.baidu.com/question/300870310.html

linux shell脚本中cd命令无效

 

 

相关文章:

  • 2022-12-23
  • 2021-09-09
  • 2021-09-14
  • 2021-08-01
  • 2022-02-16
  • 2021-06-14
  • 2022-02-25
猜你喜欢
  • 2022-12-23
  • 2021-10-31
  • 2022-03-04
  • 2021-12-10
  • 2021-10-21
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案