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

Re: surprise with echo



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:

> It's how array expansion works in the "rc" shell, which is the source
> from which this behavior is borrowed.  There's probably an "rc" list
> somewhere where you might get an explanation.

Just for the sake of completeness, this actually differs between
Byron's rc and the Bell Labs rc:

% /usr/bin/rc
; echo $version
1.7.2 $Release: @(#)rc 1.7.2 2014-09-10 $
; x=()
; echo foo$x
foo

% /opt/plan9/bin/rc
% x=()
% echo foo$x
rc (/opt/plan9/bin/rc): null list in concatenation

Neither is how RC_EXPAND_PARAM works, but I think that the zsh
behavior makes most sense.  (And is best enabled using foo$^x on demand.)

-- 
Christian Neukirchen  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org



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