summaryrefslogtreecommitdiffstats
path: root/source/a/coreutils/coreutils-dircolors.sh
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/a/coreutils/coreutils-dircolors.sh
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/a/coreutils/coreutils-dircolors.sh')
-rw-r--r--source/a/coreutils/coreutils-dircolors.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/source/a/coreutils/coreutils-dircolors.sh b/source/a/coreutils/coreutils-dircolors.sh
new file mode 100644
index 000000000..728ea7452
--- /dev/null
+++ b/source/a/coreutils/coreutils-dircolors.sh
@@ -0,0 +1,65 @@
+# Slackware color ls profile script for /bin/sh-like shells.
+
+# Set up LS_OPTIONS environment variable.
+# This contains extra command line options to use with ls.
+# The default ones are:
+# -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
+
+# COLOR needs one of these arguments:
+# 'auto' colorizes output to ttys, but not pipes.
+# 'always' adds color characters to all output.
+# '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
+export LS_OPTIONS;
+unset COLOR
+unset OPTIONS
+
+# Set up aliases to use color ls by default. A few additional
+# 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 "$@" ; };
+
+# Set up the LS_COLORS environment:
+if [ -f $HOME/.dir_colors ]; then
+ eval `/bin/dircolors -b $HOME/.dir_colors`
+elif [ -f /etc/DIR_COLORS ]; then
+ eval `/bin/dircolors -b /etc/DIR_COLORS`
+else
+ eval `/bin/dircolors -b`
+fi
+