Originally posted by dirlewanger88
Announcement
Collapse
No announcement yet.
GNU Bash 5.1 Released With New "SRANDOM" Variable As A New Means Of Randomness
Collapse
X
-
Originally posted by dirlewanger88arrays seem to be coming to sh in the next POSIX spec.
As someone who has had to deal with busybox, I agree that most of the bashisms are trivially avoidable, and that arrays, as you mention, is the single exception to that. I call POSIX shell disqualified for purposes of safe shellscripting because of that: Arrays are a necessity for correctness way too often in shellscripting.Last edited by andreano; 09 December 2020, 04:37 PM.
Leave a comment:
-
I still useCode:#!/usr/bin/env sh
Leave a comment:
-
Originally posted by dirlewanger88Shell scripts should be written in POSIX sh, unless there's a reason not to.
- Likes 2
Leave a comment:
-
Originally posted by creoflux View Post
The more likely scenario is that Corporate firewall / policy will prohibit it. Ultimately, I actually agree with this, it is probably a good thing... I just get to re-implement whatever it is.
Leave a comment:
-
Originally posted by skeevy420 View Postor some Python person saying I'm not gonna use Pip because someone might not have the internet available.
Leave a comment:
-
Originally posted by jabl View Post
Or then you just put "#!/bin/bash" in your shell script and forget about POSIX sh?
Leave a comment:
-
Originally posted by dirlewanger88...
Right now are you obsessed, suffer a superiority complex and write comments like a child who is counting with its fingers, and I cannot imagine that you would want to be taken serious.
- Likes 1
Leave a comment:
-
Originally posted by microcode View Post
FWIW fish is incompatible even with most POSIX shell stuff. It's no great big deal that it doesn't yet also include this special symbol.
Leave a comment:
-
Originally posted by dirlewanger88Shell scripts should be written in POSIX sh, unless there's a reason not to...
What you want to say is that one should use a better shell than what the basic standard has to offer when possible. One finds bash on almost every and even the most basic Linux installations. There is plenty of goodness in bash worth using. From associative arrays, arithmetic expressions, extended variable substitutions and lots more.
I would sooner force a user to install bash before I give up on these features, because giving up on these when you need them means you'll have to implement these through other means such as command pipes where you end up wasting lots of CPU cycles, create dependencies on external commands (i.e. expr, sed, basename, etc.), and will have to rely on their standard conformance, too.
POSIX sh is a standard for creating backwards compatibility. Only use it when you need this compatibility more than anything else. Most distribution, i.e. Debian-based ones, use a mix of bash and sh scripts for the system and you can rely on finding a /bin/bash installed.
And when bash isn't enough then don't hesitate to use perl or python or something else. Don't go backwards, but use the better tools that are out there.
- Likes 1
Leave a comment:
Leave a comment: