Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Help on zsh grammar
- X-seq: zsh-users 623
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Hrvoje Niksic <hniksic@xxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Help on zsh grammar
- Date: Wed, 22 Jan 1997 23:23:58 -0800
- In-reply-to: Hrvoje Niksic <hniksic@xxxxxxx> "Re: Help on zsh grammar" (Jan 23, 7:31am)
- References: <Pine.SV4.3.95.970122185019.1005B-100000@xxxxxxxxxxxxxxxxx> <970122113559.ZM3128@xxxxxxxxxxxxxxxxxxxxxxx> <kigiv4osy09.fsf@xxxxxxxxxxxxx>
- Reply-to: schaefer@xxxxxxx
On Jan 23, 7:31am, Hrvoje Niksic wrote:
} Subject: Re: Help on zsh grammar
}
} Bart Schaefer (schaefer@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
} > alias test 'noglob test'
}
} This should be:
} alias test='noglob test'
Er, yes. I always forget that I use:
alias() {
local cmd eq
if [[ $# -eq 0 ]]
then
cmd=-L
else
cmd="$1"
shift
fi
if [[ $# -gt 0 ]]
then
eq='='
else
eq=
fi
builtin alias "$cmd"$eq"$@"
}
Also, what I said about the order of defining aliases and functions was
not quite what I meant.
The rule is: Define first those aliases you expect to use in the body
of a function, but define the function first if the alias has the same
name as the function.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.nbn.com/people/lantern
Messages sorted by:
Reverse Date,
Date,
Thread,
Author