Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: few questions
- X-seq: zsh-users 4486
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Bruno Bonfils <bruno@xxxxxxxxxxx>, Zsh-users List <zsh-users@xxxxxxxxxx>
- Subject: Re: few questions
- Date: Wed, 21 Nov 2001 16:07:52 +0000
- In-reply-to: <20011121102942.A22997@asyd>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20011121102942.A22997@asyd>
On Nov 21, 10:29am, Bruno Bonfils wrote:
}
} alias ls='ls --color'
} alias 'ls -l'='ls -lh --color' <- doesn't work :(
This is what shell functions are for.
function ls {
case "$1" in
-l) command ls --color -h "$@";;
*) command ls --color "$@";;
esac
}
Equivalently but more obscurely:
function ls {
[[ "$1" == -l ]] && 1=-lh
command ls --color "$@";
}
Be sure to remove your alias for `ls' if you're going to use a function.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author