From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Cc: 131337-forwarded@bugs.debian.org
Subject: problems with RANDOM in subshells
Date: Wed, 30 Jan 2002 22:20:41 -0500 [thread overview]
Message-ID: <20020131032041.GA13560@dman.com> (raw)
One can work around the problem described below by doing
: $RANDOM ; (echo $RANDOM) | cat
Should the random-seeding behavior be changed for subshells?
----- Forwarded message from Falk Hueffner <falk@debian.org> -----
For each subshell, $RANDOM gets initialized to the same value, which
leads to the same sequence of random numbers. This makes
e. g. playlist shuffling functions way boring, and is generally not
what one would expect.
falk@borkum:~% (echo $RANDOM) | cat
12042
falk@borkum:~% (echo $RANDOM) | cat
12042
falk@borkum:~% (echo $RANDOM) | cat
12042
Falk
-- System Information
Debian Release: 3.0
Architecture: alpha
Kernel: Linux borkum 2.4.16 #1 Sat Dec 1 23:02:59 CET 2001 alpha
Locale: LANG=C, LC_CTYPE=de_DE
Versions of packages zsh depends on:
ii libc6.1 2.2.4-7 GNU C Library: Shared libraries an
ii libcap1 1:1.10-12 support for getting/setting POSIX.
ii libncurses5 5.2.20020112a-2 Shared libraries for terminal hand
----- End forwarded message -----
next reply other threads:[~2002-01-31 3:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-31 3:20 Clint Adams [this message]
2002-01-31 3:46 ` Zefram
2002-01-31 4:03 ` Bart Schaefer
2002-01-31 4:06 ` Bart Schaefer
2002-01-31 11:34 ` Peter Stephenson
2002-01-31 11:07 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020131032041.GA13560@dman.com \
--to=clint@zsh.org \
--cc=131337-forwarded@bugs.debian.org \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).