diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-01 00:59:38 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-01 00:59:38 +1200 |
commit | 9b51be856c90584d9b59df4bd19ded55b2d9fc1d (patch) | |
tree | 3e30565d39c47fc0b430831a8b16471f1f7cda8c /bash | |
parent | More sensible use of local (diff) | |
download | dotfiles-9b51be856c90584d9b59df4bd19ded55b2d9fc1d.tar.gz dotfiles-9b51be856c90584d9b59df4bd19ded55b2d9fc1d.zip |
Turns out older Bash is muddled by var=()
Initialisation with an array literal doesn't work in 2.05a
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/grep.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/ls.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/prompt.bash | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash index dc26e80e..42211968 100644 --- a/bash/bashrc.d/grep.bash +++ b/bash/bashrc.d/grep.bash @@ -5,7 +5,7 @@ grepopts() { local grephelp=$(grep --help 2>/dev/null) # Start collecting available options - local grepopts=() + local -a grepopts # Add option to ignore binary files grepopts[${#grepopts[@]}]='-I' diff --git a/bash/bashrc.d/ls.bash b/bash/bashrc.d/ls.bash index a67194b5..5756d728 100644 --- a/bash/bashrc.d/ls.bash +++ b/bash/bashrc.d/ls.bash @@ -5,7 +5,7 @@ lsopts() { local lshelp=$(ls --help 2>/dev/null) # Start collecting available options - local lsopts=() + local -a lsopts # If the --color option is available and we have a terminal that supports # at least eight colors, add --color=auto to the options diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index ea336d9a..aee3df66 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -63,7 +63,7 @@ prompt() { branch=${branch##*/} # Start collecting working copy state flags - local state=() + local -a state # If there are staged changes in the working tree, add a plus sign # to the state @@ -102,7 +102,7 @@ prompt() { fi # Start collecting working copy state flags - local state=() + local -a state # If there are changes in the tree, add an exclamation mark to the # state @@ -137,7 +137,7 @@ prompt() { branch=${branch%%/*} # Start collecting working copy state flags - local state=() + local -a state # If there are changes in the working directory, add an exclamation # mark to the state |