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

Re: surprise with echo



On Dec 18, 2014, at 11:14 PM, Kurtis Rader <krader@xxxxxxxxxxxxx> wrote:

> I created a shell script containing
> 
> #!/usr/bin/rc
> 
> echo echoing1: $@
> echo echoing2: $*
> echo echoing3: $* $@ killed
> echo echoing4: $@ $* dead
> 
> echo aaa^$*^bbb
> echo ccc^$@^ddd

This doesn't reproduce the environment Ray had because your positional parameters get substituted into their own words.

% cat /private/tmp/x.zsh
echo echoing1: $@
echo echoing2: $*
echo echoing3: $* $@ killed
echo echoing4: $@ $* dead
echo aaa^$*^bbb
echo ccc^$@^ddd
echo
echo "echoing5: $@"
echo "echoing6: $*"
echo "echoing7: $* $@ killed"
echo "echoing8: $@ $* dead"
% zsh !$
zsh /private/tmp/x.zsh
echoing1:
echoing2:
echoing3: killed
echoing4: dead
aaa^^bbb
ccc^^ddd

echoing5: 
echoing6: 
echoing7:   killed
echoing8:   dead
% zsh -P !$
zsh -P /private/tmp/x.zsh
echoing1:
echoing2:
echoing3: killed
echoing4: dead




echoing6: 


%

vq


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