this post was submitted on 20 Feb 2024
-1 points (46.2% liked)

Linux

2411 readers
9 users here now

Shit, just linux.

Use this community for anything related to linux for now, if it gets too huge maybe there will be some sort of meme/gaming/shitpost spinoff. Currently though… go nuts

founded 1 year ago
MODERATORS
 

'Well it's only passing mv a list of--' yeah yeah yeah, I know, and that's why I'm calling bullshit. It should be massively harder to execute filenames. Even if 1970s decisions make that the eternal hideous default: the lack of any idiot-proof standard workaround is incomprehensible.

StackOverflow's full of competing one-liners and people pointing out how each one is considered harmful. The least-skeezy options use exec. That sentence should make anyone recoil in horror.

This is not a filename problem. This is a tool problem. If a single printable character is going to silently expand into a list of names, then for god's sake, having it put each name in quotes should be fucking trivial.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 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:

$ printf %s\\n *.jpg

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.