3 ms·
Note that quite a lot of these problems would just go away if people would just stop trying to conform to some "portable" POSIX nonsense. There's no reason why
by matheusmoreira 3y ago
Note that quite a lot of these problems would just go away if people would just stop trying to conform to some "portable" POSIX nonsense. There's no reason why shell scripting needs to be this painful but people keep doing it to themselves by restricting themselves to the smallest possible subset of features, the most ancient ones at that. The so called "bashisms" for example make everything so much easier and less error prone but people act like it's wrong to use those features. When you read stuff about shell scripting there's usually an entire section on avoiding the evil bashisms and torturing the shell script until it runs in the mythical POSIX shell as if it was some kind of virtuous thing to do, like bash is pushing you into temptation or something.
Just throw POSIX into the trash where it belongs. Then we can finally evolve past it.
Also, shellcheck is a wonderful tool. The script isn't done until shellcheck stops complaining.