Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: surprise with echo
- X-seq: zsh-users 19586
- From: Lawrence Velázquez <larryv@xxxxxxxxxxxx>
- To: Kurtis Rader <krader@xxxxxxxxxxxxx>
- Subject: Re: surprise with echo
- Date: Thu, 18 Dec 2014 23:39:35 -0500
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:content-type:mime-version :subject:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; s=smtpout; bh=05ejK4ay3M/Qcw+ptr/HpfH jyTU=; b=AhYqoiZtmxnNTYn2fk3cAU8JuafN2NeFY/NZb/NFe5lRxZ9oFCTf8QF kCC4Iu1uFG7fws80/R7rNH2EwxSmpTKHJ2d6yrD2S/tWjEnXDhQ1c2A0FRq/NiNZ 4N2AS4sZPjpIqUmTPa5UqC5x6wIDQIYHW7+x1pFKmykgVdllfoU8=
- In-reply-to: <CABx2=D8EU+uFXizT99ETXMZKScrFAeyEezeV9NgsLe8=Sdv4Bg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <54937E5B.2020008@eastlink.ca> <141218190653.ZM16331@torch.brasslantern.com> <CABx2=D8EU+uFXizT99ETXMZKScrFAeyEezeV9NgsLe8=Sdv4Bg@mail.gmail.com>
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