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

Re: Rationalized? aliases



Mark Borges wrote:
> An interesting idea, but it doesn't seem to do the same thing on my
> system:
> 
> 	$ e="gnuclient -q"
> 	$ echo $=e
> 	gnuclient -q
> 	$ alias e="$=e -h $HOMESYSTEM"
> 	$ type e
> 	e is an alias for gnuclient
> 	$ alias e="gnuclient -h $HOMESYSTEM"
> 	$ type e
> 	e is an alias for 'gnuclient -h foo'
> 	$
> 
> does it (HOMESYSTEM=foo here) ?
> 
> Unless this is an hzoli-ism...

It is.  I think if one writes $=e she wants to split something.  So it is not
a bug but a feature.

Even `rc' expansion can be used:

 % foo='a b c'
 % echo "${^=foo}bar"
abar bbar cbar

But splitting is disabled when the result should be one word:

 % bar="${^=foo}bar"
 % echo $bar
a b cbar

Bye,

  Zoltan



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