-p FILE (conditional operator)

true if the file exists and is a named pipe (also known as a FIFO).

Examples

Different ways to test if a file is a named pipe:
1
2
3
4
test -p ~/file && echo "named pipe"
[ -p ~/file ] && echo "named pipe"
# Bash
[[ -p ~/file ]] && echo "named pipe"
BashSupport Pro 是一个 支持 -p 的 Bash 集成开发工具 – 马上试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款