It expands *.jpg
into a list of names.
Which you’d think would mean mv “thing.jpg” “other thing.jpg”
, but no, it does mv thing.jpg other thing.jpg
- and then chokes, because other
is not a valid option or filename. Possibly after writing the contents of other thing.jpg
onto the destination thing.jpg
.
If any filenames contain characters like ;
or &
, you better hope the next word doesn’t look like a command.
NeatNit@discuss.tchncs.de 9 months ago
I’m also a bit lost. From the final sentence “having it put each name in quotes should be fucking trivial.” OP seems to complain that filenames with spaces expand into multiple arguments. I can’t recreate this with this command in bash:
This command prints each argument in its own line. Replace
*.jpg
with whatever to prove it to yourself. Filenames with spaces show in full in a single line for me.