From: Michael Prokop Date: Mon, 19 May 2008 22:25:05 +0000 (+0200) Subject: Add new function ansi-colors() X-Git-Tag: 0.3.51~7^2~2 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=e2207cdcaa24da681907bc27f86aa56a296eb1bb;hp=4ba5622bf8f00cf8d882ac96a639560622da068f;p=grml-etc-core.git Add new function ansi-colors() --- diff --git a/debian/changelog b/debian/changelog index 83e751b..4318d70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,10 @@ grml-etc-core (0.3.51) unstable; urgency=low * zshrc: Add persistent dirstack support for shells older than 4.2.0 [ Michael Prokop ] - * zshrc: Add support for ${HOME}/.zshenv. + * zshrc: + - Add support for ${HOME}/.zshenv. + - Add new function ansi-colors() [via harnir] + - Support .deb in show-archive() [via harnir] * zshenv: set $PATH on Solaris/SunOS. -- Michael Prokop Sat, 17 May 2008 22:53:04 +0200 diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 3d008a1..630272e 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -599,6 +599,7 @@ show-archive() { *.tgz) tar -ztf $1 ;; *.zip) unzip -l $1 ;; *.bz2) bzless $1 ;; + *.deb) dpkg-deb --fsys-tarfile $1 | tar -tf - -- ;; *) echo "'$1' Error. Please go away" ;; esac else @@ -622,6 +623,22 @@ readme() { fi } +# function ansi-colors() +#f5# Display ANSI colors +ansi-colors() { + typeset esc="\033[" line1 line2 + echo " _ _ _40 _ _ _41_ _ _ _42 _ _ 43_ _ _ 44_ _ _45 _ _ _ 46_ _ _ 47_ _ _ 49_ _" + for fore in 30 31 32 33 34 35 36 37; do + line1="$fore " + line2=" " + for back in 40 41 42 43 44 45 46 47 49; do + line1="${line1}${esc}${back};${fore}m Normal ${esc}0m" + line2="${line2}${esc}${back};${fore};1m Bold ${esc}0m" + done + echo -e "$line1\n$line2" + done +} + # suidfind() { ls -latg $path | grep '^...s' } #f5# Find all files in \$PATH with setuid bit set suidfind() { ls -latg $path/*(sN) }