-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not running on bash <= 4.1 #16
Comments
Hm, seems your version of bash doesn't have global variables (-g). If
|
Declare -x is the other method for global variables. |
|
That is true they are not the same but for bash 3.2 that is the only alternative and so far does the trick. I got most of the framework sourced without any errors after I changed the declares and modified the Aliases but made no direct function calls. Most recently I was working on log.sh attempting to use eval and indirect variable references to mimic the associative arrays. I manage scripts that run on both 3.2 and 4.2 so I know some methods for portability. |
Ah, cool. Did you manage to get console logging running? |
I did but it required changing some major parts to Color.sh declare/export only allow characters A-Z, a-z, 0-9, and _ Also had to change UI_Color_IsAvailable to a function that performs the same check. Also: Then the call below seemed to work without errors. |
Cool, thanks for investigating! |
Will this get integrated into the next release? |
@Tzrlk I think a version supporting bash 3 would have to differ by quite a bit of modules, but I'd be up for supporting bash 4.0 in master if you wanna PR that. PR's welcome for both, we can keep the backwards compatible version in a |
Have this error when running your-script.sh on Solaris.
$ uname -a
SunOS localhost 5.11 11.2 sun4v sparc sun4v
$ bash --version
GNU bash, version 4.1.17(1)-release (sparc-sun-solaris2.11)
$ ./your-script.sh
/pkg/my/tools/bash-oo/lib/oo-bootstrap.sh: line 44: declare: -g: invalid option
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
/pkg/my/tools/bash-oo/lib/oo-bootstrap.sh: line 45: declare: -g: invalid option
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
/pkg/my/tools/bash-oo/lib/oo-bootstrap.sh: line 176: declare: -g: invalid option
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
/pkg/my/tools/bash-oo/lib/oo-bootstrap.sh: line 177: declare: -g: invalid option
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
/pkg/my/tools/bash-oo/lib/oo-bootstrap.sh: line 178: declare: -g: invalid option
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
/pkg/my/tools/bash-oo/lib/oo-bootstrap.sh: line 190: declare: -g: invalid option
declare: usage: declare [-aAfFilrtux] [-p] [name[=value] ...]
The text was updated successfully, but these errors were encountered: