diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-18 23:34:23 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-18 23:34:23 +1200 |
commit | b376e929cfd3e9bea42d2fe6abf164211c6bc6a6 (patch) | |
tree | ebd3f3311e0c6a048144fe991a11c23dea315dfb /bash/bashrc.d/ls.bash | |
parent | Use double-quoted printf strings for newlines (diff) | |
download | dotfiles-b376e929cfd3e9bea42d2fe6abf164211c6bc6a6.tar.gz dotfiles-b376e929cfd3e9bea42d2fe6abf164211c6bc6a6.zip |
Use arrays to collect options for ls/grep aliases
Diffstat (limited to 'bash/bashrc.d/ls.bash')
-rw-r--r-- | bash/bashrc.d/ls.bash | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/ls.bash b/bash/bashrc.d/ls.bash index 0fda4ed8..9446c56e 100644 --- a/bash/bashrc.d/ls.bash +++ b/bash/bashrc.d/ls.bash @@ -1,11 +1,11 @@ # Function returns calculated options for ls __lsopts() { - local lsopts= + local -a lsopts local lshelp="$(ls --help 2>/dev/null)" if [[ "$lshelp" == *--color* && "$(tput colors)" -ge 8 ]]; then - lsopts="${lsopts} --color=auto" + lsopts[${#lsopts[@]}]='--color=auto' fi - printf '%s' "$lsopts" + printf -- "${lsopts[*]}" } # Alias ls with these options |