3 ms·
uhm, sorry? shouldn't glob be handled by the shell? I mean, the "ls" program does not handle literally '*.txt', but "foo.txt bar.txt baz.txt"
by _ZeD_ 11y ago
uhm, sorry?
shouldn't glob be handled by the shell?
I mean, the "ls" program does not handle literally '*.txt', but "foo.txt bar.txt baz.txt"
- codezero 11y agoRight but ls calls getopt – and determines the meaning of the values provided. After a glob, of say, * .txt, and let's say there are a.txt, b.txt and c.txt, if I call ls * .txt -ltra it expands to ls a.txt b.txt c.txt -ltra In POSIX it expects options to appear before files, see: https://en.wikipedia.org/wiki/Getopt#Example_1_.28using_POSIX_standard_getopt.29 https://en.wikipedia.org/wiki/Getopt#Example_1_.28using_POSI... Trust me, I wish this were not adhered to, but it is.