All I can tell you is that, in my opinion, it’s ridiculous and terrible that old-school terminals haven’t been replaced yet with something more user-friendly and self-explanatory, at least in the same-machine user space. But given that they are what they are, some basic understanding of what shells do is required in order to use them, and you don’t have that understanding (I don’t fault you for this).
The key point here is that programs/commands always receive an array of string arguments, and it’s the shell’s job to translate your command line into that. Quoting (like in -m=“my message”
), shell variables (like $HOME
) and various other things are processed by the shell and not the program, and the expectation is that the user knows this. So quotes are never visible to programs, and the upside is that programs never need to process such quotes - making these features universal without having various random bugs in each program’s implementation.
GenderNeutralBro@lemmy.sdf.org 8 months ago
This is exactly correct. This is why I say it would require a whole new OS with no regard for compatibility with current systems.
As long as arguments are typeless and transmitted in a single array, there is no universal way to make programs distinguish between an option and file name that are identical. Full stop. No way. This has nothing to do with quoting schemes.
There are conventions to work around this (like
–
) but that is at the command level, NOT the shell level. It is not universal.NeatNit@discuss.tchncs.de 8 months ago
Okay, I pretty much agree with you in theory, but in practice you’re basically describing PowerShell which I just cannot. :P
GenderNeutralBro@lemmy.sdf.org 8 months ago
LOL. Now I feel dirty.
To be fair, there’s a lot that PowerShell does much better than Bash and similar shells. Piping tables as tables is rad.