执行脚本提示shell-init:xxx问题分析
近日,在部署完我们的程序后,调用脚本启动程序突然提示错误:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
1 | [root@smart hello]# cat /root/Desktop/hello.sh |
对此问题,想来也十分奇怪,之前虽有出现也未进行深究,今天闲来无事就研究了下这个问题。
这个问题细细看来就是“No such file or directory”当前所处目录被删除。如下:
1 | [root@smart hello]# cat /root/Desktop/hello.sh |
同样将脚本中的解析器申明去掉,也可以得到这个效果。推测是调用解析器时需要提取当前目录导致上述错误提示。
1 | [root@smart hello]# cat /root/Desktop/hello.sh |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Helloeuler!