diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-25 12:39:47 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-25 13:21:48 +1300 |
commit | 023afa3d93036e7eca9774f7e68690d397c5e44d (patch) | |
tree | 82f79f85c6d5a142c8e7d3ef783d04c7ff8d3ef7 /sh/shrc.d/ls.sh | |
parent | Merge branch 'master' into port/bsd/freebsd (diff) | |
download | dotfiles-023afa3d93036e7eca9774f7e68690d397c5e44d.tar.gz dotfiles-023afa3d93036e7eca9774f7e68690d397c5e44d.zip |
Add FreeBSD -G to ls() wrapper
Not sure this is the correct approach yet. I'm not sure I like the CLICOLOR environment variable.
Diffstat (limited to 'sh/shrc.d/ls.sh')
-rw-r--r-- | sh/shrc.d/ls.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh index 58263e96..c7703663 100644 --- a/sh/shrc.d/ls.sh +++ b/sh/shrc.d/ls.sh @@ -31,6 +31,12 @@ ls() { [ -e "$HOME"/.cache/ls/time-style ] && set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@" + # Add -G for colorized output if the operating system is FreeBSD + # We have to check because -G means something else to e.g. GNU ls(1) + case $OS in + FreeBSD) set -- -G "$@" ;; + esac + # Run ls(1) with the concluded arguments command ls "$@" } |