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

Re: Rationalized? aliases



On Nov 8,  6:17pm, Richard Coleman wrote:
} Subject: Re: Rationalized? aliases
}
} > Now however, the rationalized alias output makes this not work:
} > 
} > % echo $ZSH_VERSION
} > 2.6-beta11
} > alias e="gnuclient -q"
} > % [[ $HOST != $HOMESYSTEM ]] && alias e="$(whence e) -h $HOMESYSTEM"
} > % type e
} > e is an alias for \''gnuclient -q'\'' -h spacely'
} > 
} > This is not what I desire ('gnuclient -q' is not a valid command) - what
} >  I want is to append "-h spacely" to the alias.  How can I do this?
} 
} Rather than changing the code of zsh for this, maybe you should
} just use
} 
} alias e="$(whence e | tr -d \') -h"
} 
} Doing things like this is what makes command substitution so
} cool.

What's wrong with:

e="gnuclient -q"
[[ $HOST != $HOMESYSTEM ]] && alias e="$=e -h $HOMESYSTEM" || alias e="$=e"

??  Why get "whence" involved at all?

-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@xxxxxxxxxx                  Division of NCD Software Corporation
http://www.well.com/www/barts



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