From fe2215ca407bc882da966f7393e05d2c3fee5f75 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 3 Dec 2007 22:18:53 +0100 Subject: [PATCH] zsh: replace $(which ...) with $(type ...) --- debian/changelog | 6 +++++- etc/skel/.zshrc | 18 +++++++++--------- etc/zsh/zshrc | 24 ++++++++++++------------ 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5c31d8b..1f03fe4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ grml-etc-core (0.3.41) unstable; urgency=low - * /etc/skel/.zshrc: add alias 'g' for git. + * /etc/zsh/zshrc: + - replace $(which ...) with $(type ...) + * /etc/skel/.zshrc: + - replace $(which ...) with $(type ...) + - add alias 'g' for git. -- Michael Prokop Sun, 02 Dec 2007 19:54:45 +0100 diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 7230685..75cacc2 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -48,10 +48,10 @@ if [ -z "$BROWSER" ] ; then if [ -n "$DISPLAY" ] ; then #v# If X11 is running - [ -x $(which firefox) ] && export BROWSER=firefox + [ -x $(type firefox) ] && export BROWSER=firefox else #v# If no X11 is running - [ -x $(which w3m) ] && export BROWSER=w3m + [ -x $(type w3m) ] && export BROWSER=w3m fi fi #v# @@ -197,7 +197,7 @@ #a2# Execute \kbd{mkdir -o} alias md='mkdir -p' - [ -x $(which ipython) ] && alias ips='ipython -p sh' + [ -x $(type ipython) ] && alias ips='ipython -p sh' # console stuff #a2# Execute \kbd{mplayer -vo fbdev} @@ -229,15 +229,15 @@ # work around non utf8 capable software in utf environment via $LANG and luit if type isutfenv &>/dev/null && type luit &>/dev/null; then - if [ -x $(which mrxvt) ] ; then + if [ -x $(type mrxvt) ] ; then isutfenv && [ -n "$LANG" ] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit mrxvt" fi - if [ -x $(which aterm) ] ; then + if [ -x $(type aterm) ] ; then isutfenv && [ -n "$LANG" ] && alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit aterm" fi - if [ -x $(which centericq) ] ; then + if [ -x $(type centericq) ] ; then isutfenv && [ -n "$LANG" ] && alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit centericq" fi fi @@ -908,7 +908,7 @@ # highlight important stuff in diff output, usage example: hg diff | hidiff #m# a2 hidiff \kbd{histring} oneliner for diffs - [ -x $(which histring) ] && \ + [ -x $(type histring) ] && \ alias hidiff="histring -fE '^Comparing files .*|^diff .*' | histring -c yellow -fE '^\-.*' | histring -c green -fE '^\+.*'" # rename pictures based on information found in exif headers @@ -977,7 +977,7 @@ # hl() highlighted less # http://ft.bewatermyfriend.org/comp/data/zsh/zfunct.html - if [ -x $(which highlight) ] ; then + if [ -x $(type highlight) ] ; then function hl() { local theme lang theme=${HL_THEME:-""} @@ -1190,7 +1190,7 @@ # Work around ion/xterm resize bug. #if [ "$SHLVL" = 1 ]; then -# if [ -x $(which resize) ]; then +# if [ -x $(type resize) ]; then # eval `resize &2 get_3ware @@ -1076,7 +1076,7 @@ Please use the wodim binary instead' ; return 1" fi # I hate lacking backward compatibility, so provide an alternative therefore - if ! [ -x $(which apache2-ssl-certificate) ] ; then + if ! [ -x $(type apache2-ssl-certificate) ] ; then apache2-ssl-certificate(){ print 'Debian does not ship apache2-ssl-certificate anymore (see #398520). :(' @@ -1266,19 +1266,19 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." fi } - if [ -x $(which 915resolution) ] ; then + if [ -x $(type 915resolution) ] ; then alias 855resolution='echo -e "Please use 915resolution as resolution modify tool for Intel graphic chipset."; return -1' fi #a1# Output version of running grml alias grml-version='cat /etc/grml_version' - if [ -x $(which rebuildfstab) ] ; then + if [ -x $(type rebuildfstab) ] ; then #a1# Rebuild /etc/fstab alias grml-rebuildfstab='rebuildfstab -v -r -config' fi - if [ -x $(which grml-debootstrap) ] ; then + if [ -x $(type grml-debootstrap) ] ; then alias debian2hd='print "Installing debian to harddisk is possible via using grml-debootstrap." ; return 1' fi } @@ -1352,7 +1352,7 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." # manzsh() { man zshall | $MYLESS -p $1 ; } fi - if [ -x $(which most) ] ; then + if [ -x $(type most) ] ; then #f1# View Debian's changelog of a given package dchange() { if [ -r /usr/share/doc/${1}/changelog.Debian.gz ] ; then -- 2.1.4