Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Help on zsh grammar



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