Re:Filenames and Pathnames in Shell: How to Do It Correctly
by tyingq on Tuesday June 20, 2023 @09:29AM
(#36403683)
Another approach is adding filenames after a "--" terminating option. Most, though not all, commands support it, like:
[ Parent
| on HN ]
Re:Filenames and Pathnames in Shell: How to Do It Correctly
by Anthony-G on Tuesday June 20, 2023 @01:45PM
(#36407676)
This is discussed in the featured article: https://dwheeler.com/essays/filenames-in-shell.html#dashdash
As you point out, not all commands support this convention and the author feels that it would be hard to enforce this consistently among maintainers. I agree that it would be easier (for me) to remember to prefix globs with `./`.
Re:Filenames and Pathnames in Shell: How to Do It Correctly
by tyingq on Tuesday June 20, 2023 @02:20PM
(#36408258)
I'd argue it's not quite as terrible as the author suggests. Getopt(3), for example, uses it, so many programs pick it up from there. As do many popular getopt() variations for other languages...Golang's "flag" built-in, for example. So it's not universal, but it's also more common than you might imagine.