On 2026-01-10 18:59, Andrew L. Moore wrote:
For what it's worth, GNU sed and awk provide a similar diagnostic:
No, those programs behave as expected. They say that the file is *not* a
directory, instead of incorrectly saying that it *is* a directory.
Here's an example where GNU ed misreports the error whereas GNU sed and
awk do the right thing:
$ ed /dev/null/
/dev/null/: Is a directory
q
$ sed q /dev/null/
sed: can't read /dev/null/: Not a directory
$ awk '{print}' /dev/null/
awk: fatal: cannot open file `/dev/null/' for reading: Not a directory
The One True Awk evidently discards directory arguments without any
diagnostic, as do Solaris implementations of sed and ed:
That's not what this bug report is about. It is about files that are not
directories, but their names have "/" appended. And for these files,
Solaris 10 consistently reports a diagnostic (though perhaps not the
best one). Here's Solaris 10 on the same example:
$ PATH=/usr/bin
$ ed /dev/null/
?/dev/null/
q
$ sed q /dev/null/
Can't open /dev/null/
$ awk '{print}' /dev/null/
awk: can't open /dev/null/