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

Re: why won't this function work?



It's generally preferable if you supply some details about the difference
between what does happen and what you intend to have happen, rather than
just say "doesn't work."

However, some possible clues ...

On Thu, 8 Jul 2004 gj@xxxxxxxxxxxxx wrote:

>     (( " $# < 1 " )) && {

Don't put quotes around the expression inside the double parens.  All that
accomplishes is to fool zsh into thinking you meant to create a subshell,
so it attempts to execute a command rather than evaluate math.

>     cmd=("" `grep -w $1 $HISTFILE | sort | uniq | pr -tn` "");

Unless you have setopt KSH_ARRAYS, zsh numbers arrays from 1, not from 0,
so the leading empty element may be throwing off your subscript later.  I
have no idea why the trailing empty element is there.



Messages sorted by: Reverse Date, Date, Thread, Author