3 ms·
> Try this: touch a; ls -? I don't see it. What are you trying to show with 'a' instead of '-l'? Why would a file named 'a' interact with a glob like '-?'?
by me-vs-cat 2y ago
> Try this: touch a; ls -?
I don't see it. What are you trying to show with 'a' instead of '-l'? Why would a file named 'a' interact with a glob like '-?'?
$ touch a
$ ls -?
zsh: no matches found: -?
$ bash -c 'ls -?'
ls: invalid option -- '?'
Try 'ls --help' for more information.
$ dash -c 'ls -?'
ls: invalid option -- '?'
Try 'ls --help' for more information.
$ touch ./-l
$ ls -?
.rw-rw-r-- 0 user 10 Feb 18:32 -l
.rw-rw-r-- 0 user 10 Feb 18:31 a
- TeMPOraL 2y agoZSH must handle globs in some weird way? '?' is glob for one character, '-?' means "dash followed by any character", and that's what I'd expect to be matched, and that's what my `ls` does.
- lloeki 2y ago> '-?' means "dash followed by any character" but `a` is not "dash followed by one character" so the glob does not match a `a` file? my haha nearby was wrong! I should have tested it :)
- me-vs-cat 2y agoI have a non-default option on for zsh, which is incredibly useful interactively. (Bash also has this option, but I haven't enabled it.) Normally, ls doesn't expand globs. Why did you say to try "touch a; ls -?"? What am I supposed to see from those two commands?