diff options
-rw-r--r-- | bash/bashrc.d/grep.bash | 8 | ||||
-rw-r--r-- | bash/bashrc.d/ls.bash | 2 |
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 |