In order to test if a file exists I do:
if [ -f $FILE ];
but it doesn't work if $FILE is a named pipe, e.g. ls -l pipename
shows a pipe with p attribute:
prw-r--r-- 1 usr grp 0 Nov 26 02:22 pipename
How to test if a named pipe exists?
You could use the -p
test
if [[ -p $pipe ]]
or
if [ -p "$pipe" ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With