Skip to content

Commit

Permalink
Bump minimal Bash version from 2.05 to 3.0
Browse files Browse the repository at this point in the history
This is required by the use of `<<<` to compose the `S2_*` and `ax_*`
arrays.

I could use here-docs `<<` instead, but there's another reason to bump
this version: the oldest supported version in the official Docker image
for Bash is 3.0.

So getting an old 2.05 and put automated tests for it would be a
deviation for the procedure already in place for all the other versions.

Version 2.05 is from 2001 and 3.0 is from 2004. We're still supporting a
very old version anyway.

Now every supported Bash version is properly tested in the CI.
  • Loading branch information
aureliojargas committed May 12, 2020
1 parent a85e6b3 commit d0c6254
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The format is based on [Keep a Changelog].

### Changed

- Bumped minimal required Bash version from 2.04 to 2.05
- Bumped minimal required Bash version from 2.04 to 3.0
- Bumped the versions for all the supported programs
- Validated and updated the regex data for all the supported programs,
thanks to the new regex tester. Some programs now support new
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Author: [Aurelio Jargas](https://aurelio.net/about.html)
- License: GPL
- First release: 2001-02-23
- Requires: Bash >= 2.05
- Requires: Bash >= 3.0
- Website: https://aurelio.net/projects/txt2regex/

Txt2regex is a regular expression wizard that converts human sentences
Expand Down
8 changes: 4 additions & 4 deletions txt2regex.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
# txt2regex.sh - Regular Expressions "wizard", all in bash2 builtins
# txt2regex.sh - Regular Expressions "wizard" made with Bash builtins
#
# Website : https://aurelio.net/projects/txt2regex/
# Author : Aurelio Jargas ([email protected])
# License : GPL
# Requires: bash >= 2.05
# Requires: bash >= 3.0
#
# shellcheck disable=SC1117,SC2034
# SC1117 because it was obsoleted in shellcheck >0.5
Expand Down Expand Up @@ -96,11 +96,11 @@ printError() {
}

case "$BASH_VERSION" in
2.0[5-9]* | 2.[1-9]* | [3-9].*)
[3-9].*)
: # do nothing
;;
*)
printError 'Bash version >=2.05 required, but you have %s\n' "$BASH_VERSION"
printError 'Bash version >=3.0 required, but you have %s\n' "$BASH_VERSION"
;;
esac

Expand Down

0 comments on commit d0c6254

Please sign in to comment.