[Help-bash] Is there a way to make unamed pipe nonexist upon error?
From:
Peng Yu
Subject:
[Help-bash] Is there a way to make unamed pipe nonexist upon error?
Date:
Wed, 25 Sep 2019 22:39:17 -0500
Hi,
awk does not know there is not a file called nosuchfile.txt because
the unnamed pipe looks OK. Is there a way to make the pipe
unavailable, so that awk knows there is some error with the file `f`?
Thanks.
$ awk -v f=<(cat nosuchfile.txt) -e 'BEGIN { r = getline < f ; print r }'
cat: nosuchfile.txt: No such file or directory
0
--
Regards,
Peng