zsh-workers
 help / color / mirror / code / Atom feed
* funny subshell effect
@ 2011-03-09 23:18 Mikael Magnusson
  2011-03-10  0:29 ` Phil Pennock
  2011-03-10 14:56 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Mikael Magnusson @ 2011-03-09 23:18 UTC (permalink / raw)
  To: zsh workers

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-17  3:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-09 23:18 funny subshell effect Mikael Magnusson
2011-03-10  0:29 ` Phil Pennock
2011-03-10 14:56 ` Bart Schaefer
2011-03-10 15:11   ` Mikael Magnusson
2011-03-17  3:44     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).