3 ms·
Or just use a sane shell (eg. the oil shell https://www.oilshell.org/blog/2020/10/osh-features.html#eliminate-quoting-hell-the-qefs-problem https://www.oilshell
by diegocg 3y ago
Or just use a sane shell (eg. the oil shell https://www.oilshell.org/blog/2020/10/osh-features.html#eliminate-quoting-hell-the-qefs-problem https://www.oilshell.org/blog/2020/10/osh-features.html#elim..., fish) where handling pathnames with spaces, etc. is not a problem and doesn't require arcane quoting knowledge or linters.
The only reason why this is an issue is that people insists in using bash in the name of backwards compatibility. It's about time people start considering moving away from bash - its design is broken and the efforts and time it takes to write safe bash shells might not be worth it.
- meinheld111 3y agoBrokenness is really a tradeof. Imho using oil/fish/etc trades unfavorable because of network effects but it is perfectly acceptable choice in many circumstances
- planede 3y agoI don't disagree, but only some of the rules are really about the shell itself. A significant part of the problem is the stringly-typed interface of exec. Avoiding passing filenames starting with "-" has little to do with shells.
- IshKebab 3y agoThe only real reason to use Bash in the first place is that people will probably have it installed already (assuming you don't care about the most popular desktop OS in the world). If you're going to add a dependency you may as well just use a "real" language at that point. I've been using Deno for "shell scripts" for a while and it's great. My only complaint is that `deno run` prints annoying "a new version of Demo is available" messages which it very clearly shouldn't. Hopefully they'll fix that.
- maleldil 3y ago> If you're going to add a dependency you may as well just use a "real" language at that point. Not necessarily. It's still easier to manipulate shell programs in fish[0] than it is in Python since fish was made explicitly for that. Calling external programs, using pipes, process substitution, etc. are easier in a "proper" shell language. [0] Or any bash alternative of your choice: nushell, oils, xonsh, elvish, etc.
- harrisi 3y agoI don't know if they're planning on changing that, but `-q|--quiet` will suppress this. It just sets the log level to error, and the new version message is info level.