$ls -l /var/run/supervisor.socksrwxrw-rw- 1 root root 0 Jun 3 13:30 /var/run/supervisor.sock # <== THE file EXISTS!!$if [ ! -f /var/run/supervisor.sock ]; then echo 'file does not exist!'; fifile does not exist!
为什么哦为什么不能bash看到该文件存在?
解决方法 http://www.tldp.org/LDP/abs/html/fto.html使用-S来测试它是否是一个套接字. -f用于常规文件.
见男人1测试:
-e file file exists -f file file exists and is a regular file ... ... -S file file exists and is a socket总结
以上是内存溢出为你收集整理的linux – 为什么bash不能识别套接字文件的存在全部内容,希望文章能够帮你解决linux – 为什么bash不能识别套接字文件的存在所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)