linux – 为什么bash不能识别套接字文件的存在
发布时间:2020-12-13 19:27:03 所属栏目:Linux 来源:网络整理
导读:在 Linux机器上,我想检查是否存在特定的套接字文件.我知道套接字文件存在,但我在bash中的检查没有向我显示: $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/su
在
Linux机器上,我想检查是否存在特定的套接字文件.我知道套接字文件存在,但我在bash中的检查没有向我显示:
$ls -l /var/run/supervisor.sock srwxrw-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!'; fi file 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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |