Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
funny subshell effect
- X-seq: zsh-workers 28875
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: funny subshell effect
- Date: Thu, 10 Mar 2011 00:18:07 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=LYijzxPNUegfCne2zBhPq1sDFkwZxnCCkm1V10vbwOw=; b=tHtkhe1cO/LEeT2yw32zarVv4zZTW2lwHd2TG0l+/hjDxa3/e5z1ZV2f1vcB1R1Gn2 bH21kIS4SFvB4lBLBpLhIOSQH20xyTUofwYvXsYfKajEqNCRfBAAvQPaWoMXR4M2yNL5 5Y8t/2c8fWvTH5ymVEXTNhsSiM8/cSD3UtbYU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=F29RUurbZMR1rjikypY9pqQhB/uYRXv34SzGJ8z8tQLMp2/1tYK3OEXFu6ENjOg991 /94dFGkE2vCLeSI2x4jYordi2duUQ3TsbalHgmv5YkVfY6o+Wdz5hUEKSQjNB63pzfak s64oLhDI/N5aVNKcMs1AtclIPvXjeLka/6ikM=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This confused me for a few minutes, I was trying to play a random midi file with
pmidi *(oe:REPLY=\$RANDOM:[1])
but it plays the same one each time, but when i tried
echo *(oe:REPLY=\$RANDOM:[1])
it printed a different one each time
% repeat 3; do echo .(e:REPLY=\$RANDOM:); done
17
25549
6369
% repeat 3; do command echo .(e:REPLY=\$RANDOM:); done
5801
5801
5801
Is this something that must be so? (My guess is yes, but it can't hurt to ask).
(I know I can work around it easily by assigning to a var first).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author