4 ms·
> If you just want a list of files in a POSIX shell you use a glob expression. I think this sums up the problem. If you want a list of files for display you us
by dwattttt 3y ago
> If you just want a list of files in a POSIX shell you use a glob expression.
I think this sums up the problem. If you want a list of files for display you use ls, and if you want it for other purposes use a glob; it seems much more elegant to have one way of getting files, and a separate way to format it for displaying if that's what you want.
- theamk 3y agoThat's already the case, just not the default. "ls -ld a*b file1.*" will use common way of getting files -- the glob expression; and "ls" will only be used to format the file list nicely. Except turns out people don't like to type extra characters, so the most common case, "ls -d *" is just "ls". Yes, shells (and command-line interface) have shortcuts to simplify typing. It's a feature, not a bug. I want to be able to type "ls -t" instead of "ls --sort=time", and any shell replacement which does not offer former option is doomed to fail.
- Ferret7446 3y agoI think most people choose a shell not based on its elegance, but whether it allows them to get things done.