aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-10 14:32:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-10 14:32:13 +1200
commit4fb0583b4c0c761d0a4c1973116c97ab0ec636cd (patch)
treee60f245feee5344bc5df0f0787bd722cfcb03b95 /bash
parentUse _ to prevent polluting namespace (diff)
downloaddotfiles-4fb0583b4c0c761d0a4c1973116c97ab0ec636cd.tar.gz
dotfiles-4fb0583b4c0c761d0a4c1973116c97ab0ec636cd.zip
Some more array syntax fixes
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/grep.bash8
-rw-r--r--bash/bashrc.d/ls.bash2
2 files changed, 5 insertions, 5 deletions
diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash
index 42211968..51892167 100644
--- a/bash/bashrc.d/grep.bash
+++ b/bash/bashrc.d/grep.bash
@@ -8,23 +8,23 @@ grepopts() {
local -a grepopts
# Add option to ignore binary files
- grepopts[${#grepopts[@]}]='-I'
+ grepopts=("${grepopts[@]}" '-I')
# If the --exclude option is available, exclude some VCS files
if [[ $grephelp == *--exclude* ]]; then
- grepopts[${#grepopts[@]}]='--exclude=.git{,ignore,modules}'
+ grepopts=("${grepopts[@]}" '--exclude=.git{,ignore,modules}')
fi
# If the --exclude-dir option is available, exclude some VCS dirs
if [[ $grephelp == *--exclude-dir* ]]; then
- grepopts[${#grepopts[@]}]='--exclude-dir=.{cvs,git,hg,svn}'
+ grepopts=("${grepopts[@]}" '--exclude-dir=.{cvs,git,hg,svn}')
fi
# If the --color option is available and we have a terminal that supports
# at least eight colors, add --color=auto to the options
local colors=$(tput colors)
if [[ $grephelp == *--color* ]] && ((colors >= 8)); then
- grepopts[${#grepopts[@]}]='--color=auto'
+ grepopts=("${grepopts[@]}" '--color=auto')
fi
# Print the options as a single string, space-delimited
diff --git a/bash/bashrc.d/ls.bash b/bash/bashrc.d/ls.bash
index 5756d728..539af506 100644
--- a/bash/bashrc.d/ls.bash
+++ b/bash/bashrc.d/ls.bash
@@ -11,7 +11,7 @@ lsopts() {
# at least eight colors, add --color=auto to the options
local colors=$(tput colors)
if [[ $lshelp == *--color* ]] && ((colors >= 8)); then
- lsopts[${#lsopts[@]}]='--color=auto'
+ lsopts=("${lsopts[@]}" '--color=auto')
fi
# Print the options as a single string, space-delimited