diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2010-05-19 08:58:23 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:43:05 +0200 |
commit | b76270bf9e6dd375e495fec92140a79a79415d27 (patch) | |
tree | 3dbed78b2279bf9f14207a16dc634b90995cbd40 /source/a/coreutils/coreutils-dircolors.sh | |
parent | 5a12e7c134274dba706667107d10d231517d3e05 (diff) | |
download | current-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz |
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010
Slackware 13.1 x86_64 stable is released!
Lots of thanks are due -- see the RELEASE_NOTES and the rest of the
ChangeLog for credits. The ISOs are on their way to replication,
a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We are taking pre-orders now at store.slackware.com, and offering
a discount if you sign up for a subscription. Consider picking up
a copy to help support the project. Thanks again to the Slackware
community for testing, contributing, and generally holding us to a
high level of quality. :-)
Enjoy!
Diffstat (limited to 'source/a/coreutils/coreutils-dircolors.sh')
-rw-r--r-- | source/a/coreutils/coreutils-dircolors.sh | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/source/a/coreutils/coreutils-dircolors.sh b/source/a/coreutils/coreutils-dircolors.sh index 728ea745..fc848c6f 100644 --- a/source/a/coreutils/coreutils-dircolors.sh +++ b/source/a/coreutils/coreutils-dircolors.sh @@ -6,13 +6,7 @@ # -F = show '/' for dirs, '*' for executables, etc. # -T 0 = don't trust tab spacing when formatting ls output. # -b = better support for special characters -if [ "$SHELL" != "/bin/zsh" ]; then - # Edit options below for all sh-like shells except zsh: - OPTIONS="-F -b -T 0" -else - # If you use zsh, edit the options below instead: - OPTIONS=( -F -b -T 0 ) -fi +OPTIONS="-F -b -T 0" # COLOR needs one of these arguments: # 'auto' colorizes output to ttys, but not pipes. @@ -20,14 +14,11 @@ fi # 'never' shuts colorization off. COLOR=auto + # This section shouldn't require any user adjustment since it is # simply setting the LS_OPTIONS variable using the information # already given above: -if [ "$SHELL" = "/bin/zsh" ]; then - LS_OPTIONS=( $OPTIONS --color=$COLOR ); -else - LS_OPTIONS=" $OPTIONS --color=$COLOR "; -fi +LS_OPTIONS="$OPTIONS --color=$COLOR"; export LS_OPTIONS; unset COLOR unset OPTIONS @@ -36,23 +27,21 @@ unset OPTIONS # aliases like 'dir', 'vdir', etc, are some ancient artifacts # from 1992 or so... possibly they should be disabled, but maybe # someone out there is actually using them? :-) -# Assume shell aliases are supported. Ash is going to freak out -# when it sees zsh syntax anyway, so whatever. -alias ls='/bin/ls $LS_OPTIONS'; -alias dir='/bin/ls $LS_OPTIONS --format=vertical'; -alias vdir='/bin/ls $LS_OPTIONS --format=long'; -alias d=dir; -alias v=vdir; - -# Just for fun, here are the old sh/ash style shell functions. -# this script isn't currently working with ash (and makes some noisy -# error messages), but perhaps these will still be of use to -# someone... -#ls () { /bin/ls $LS_OPTIONS "$@" ; }; -#dir () { /bin/ls $LS_OPTIONS --format=vertical "$@" ; }; -#vdir () { /bin/ls $LS_OPTIONS --format=long "$@" ; }; -#d () { dir "$@" ; }; -#v () { vdir "$@" ; }; +# Assume shell aliases are supported. +if [ "$SHELL" = "/bin/zsh" ] ; then + # By default, zsh doesn't split parameters into separate words + # when it encounters whitespace. The '=' flag will fix this. + # see zshexpn(1) man-page regarding SH_WORD_SPLIT. + alias ls='/bin/ls ${=LS_OPTIONS}' + alias dir='/bin/ls ${=LS_OPTIONS} --format=vertical' + alias vdir='/bin/ls ${=LS_OPTIONS} --format=long' +else + alias ls='/bin/ls $LS_OPTIONS' + alias dir='/bin/ls $LS_OPTIONS --format=vertical' + alias vdir='/bin/ls $LS_OPTIONS --format=long' +fi +alias d=dir +alias v=vdir # Set up the LS_COLORS environment: if [ -f $HOME/.dir_colors ]; then |