News for hackers. Stuff that matters.
Re:Don't Put Tilde In Your Path by akoboldfrying on Sunday October 11, 2026 @11:01AM (#50044025)
Well, the only other way I can think of that it could be done is the Windows way, whereby you pass the unparsed command line, spaces and all, as a string to the new process. And while this is arguably the cleaner interface, in practice it has meant even worse quote handling, since how -- or even whether -- double quotes are parsed now depends on the probably undocumented process startup code chosen by the program's compiler vendor.

Want to quote a command line that may already contain double quotes, in order to pass it as an argument to some other program? No, you don't. It isn't right to want that.

Re:Don't Put Tilde In Your Path by ChrisSD on Sunday October 11, 2026 @01:10PM (#50045396)
The other other way would be more structured. Arguments are not just an array, they also contain `--switch` and key/value pairs (e.g. `--key value` or `--key=value` depending on who you ask). One problem with the flat array approach is there's no way to distinguish a literal value starting with `-` from a switch, which means there needs to be some way to workaround that (and users have to remember the workaround; how often do people remember to use `rm -- "$FILENAME"`).

In practice almost every application does still need to do its own parameter parsing; a flat array is not enough.

Re:Don't Put Tilde In Your Path by NetMageSCW on Monday October 12, 2026 @02:39PM (#50060847)
VMS had a command description language that was used to define new commands and including allowed arguments and types.
Re:Don't Put Tilde In Your Path by NetMageSCW on Monday October 12, 2026 @02:38PM (#50060833)
Sure it is. How do you echo a command without executing it if the command is passed in?
Re:Don't Put Tilde In Your Path by account42 on Tuesday October 13, 2026 @11:36AM (#50073398)
And of course Microsoft couldn't even manage to keep their own two command-line quote parsing immplementations (Win32 and CRT) consistent.