Hi Alexar.
On 19/09/2021 3:25 pm, Alexar Pendashteh via luv-main wrote:
I have been using a bash script happily for quite a while. Today, for
the first time I faced an error.
I noticed the server is running *GNU bash, version 4.2.46(2)-release*
Whereas I have always been on version 5.
I don't have the access to upgrade the version. So, the questions are:
1. Is there a way to manually use bash v5 without root access?
2. Is it important or worth making the script compatible with bash v4?
I'm afraid that question falls under the category of "How long is a
piece of string?"
If your scripts rely heavily on capabilities only present in v5 then
refactoring your
scripts to work with v4 will entail a matching degree of work.
Bash v5 however is very likely to have library dependencies that the
server's version
of linux doesn't meet. That can be an even deeper rabbit hole of nested
dependencies.
So if you need to employ that particular server, then porting to bash v4
is your only
sensible alternative.
It's one of the reasons that sh is commonly used rather than bash, to
prevent specific
"bashisms" from impacting script portability. Lowest common denominator.
Regards,
Morrie.
_______________________________________________
luv-main mailing list -- [email protected]
To unsubscribe send an email to [email protected]