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

Re: PATCH: Removing aliases from history, 2015 style (was capturing output of !! not working)



On Mar 26,  9:41am, Peter Stephenson wrote:
} Subject: Re: PATCH: Removing aliases from history, 2015 style (was capturi
}
} > It may be appropriate to point out this tidbit:
} > 
} > torch% alias -g '&&'=foo
} > torch% echo foo&&bar
} > foo foobar
} 
} The original one was to be able to do
} 
}   && stuff
} 
} by aliasing (not to "foo", obviously) at the start of an expression, so
} it had its normal effect at the end.  You can't do that any more.

Sure you can.  Just not exactly the way the original example was written.

torch% alias -g '&&'='; (( $? == 0 )) && '
torch% && print this is OK
this is OK
torch% && print and so is this && print also this
and so is this
also this
torch% 



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