Re:Bash functions are better than I thought
by sodapopcan on Sunday October 31, 2021 @07:08PM
(#29061361)
My examples are a made-up idea of what a “real” programming language would look like in a shell, not actual bash.
Re:Bash functions are better than I thought
by fstrthnscnd on Monday November 01, 2021 @06:07AM
(#29064785)
Sorry, clearly my comment wasn't very helpful.
I was trying to point out that quoting parameters or not could bring a different meaning for a shell (as one could see it with Bash), with the implied consequence that one would have to carry over that nuance somehow to a shell where all parameters would have to be quoted.
With bash (and I suspect with every other popular shells out there), it actually means something different. In your second example, if you don't use quotes, the shell will do the extensions, but if you do, the process will have to do it (and in the case of ls, it cannot).
In some case it's good to have the shell taking care of it, but sometimes (eg, when using 'find') it's not.