Package: bash3
Version: 3.0-12
Severity: normal

I would expect the following command to always give the same output,
because I seed RANDOM at the outset:

  bash3 -c 'RANDOM=1; set -x; true $RANDOM; true $RANDOM | true $RANDOM'

What I find in practise, however, is that, although the first line
printed is always the same, the next 2 lines are different on each run.

My guess is that a subshell is being created to run the pipeline, and
that bash, as part of its initialisation code for a subshell, seeds
RANDOM again, wiping out the seed I specified.

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.18-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)

Versions of packages bash3 depends on:
ii  base-files              3.1.2            Debian base system miscellaneous f
ii  libc6                   2.3.2.ds1-22     GNU C Library: Shared libraries an
ii  libncurses5             5.4-4            Shared libraries for terminal hand
ii  passwd                  1:4.0.3-31sarge5 change and administer password and

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to