linux-exploit-suggester icon indicating copy to clipboard operation
linux-exploit-suggester copied to clipboard

bash compatibility

Open noraj opened this issue 6 years ago • 2 comments

$ ./les.sh
Script needs Bash in version 4.0 or newer. Aborting.

It says LES supports only bash 4.0+ and I was running it on bash 3.1 so I understand.

But on #3 you said

To avoid these kind of errors I've added bash version checking on script's startup. 4.0 is needed for associative arrays, =~ operator was added in 3.* so we should be good now.

So finally 3.* is not supported?

noraj avatar Jun 06 '19 21:06 noraj

Bash 4.0+ is required.

The comment you're referring to:

To avoid these kind of errors I've added bash version checking on script's startup. 4.0 is needed for associative arrays, =~ operator was added in 3.* so we should be good now.

is in reference to two problems discussed in that issue, both of which were encountered when using older versions of Bash.

The first issue related to associative arrays, which require Bash 4+.

The second issue related to use of =~ matches which required Bash ~3+.

we should be good now implies that a version check for 4+ was considered sufficient to close the issue. There was no point trying to support =~, as that doesn't solve the requirement for associative arrays, which requires Bash version 4+.

If, in the future, older versions of Bash were to be supported, it would require a substantial rewrite to remove the use of assoc arrays.

bcoles avatar Jun 06 '19 21:06 bcoles

@bcoles It's clear now, thank you!

noraj avatar Jun 07 '19 12:06 noraj