From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30120 invoked from network); 11 Oct 2022 01:32:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 01:32:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665451948; b=UCozJXK9eRRgAvkYVTskP3+qpjn3DHLp0fvGDWPqsq0DFkzX+ftZLyh29f7nEtP0F8MMewR6Cb mFAKfOafXpvOR23rwfJ9DUAroDIBDoqb/yKJuXQx+vPmg3AUuL5Wp9vhkas6GHG4cjE42khlZj cvmwfnl9qjPAoGyXAfxsVFQ1tnzAxmWXVyBZtQ/Ukmul4qMaBoebgLh3duAWiTdszvTavz6cRi bHCwAv2ZiQoMOfJaNmSTDANXYKis4znbrDRi2jlBVFTNxO9oy3rojBzIwBiXR5CHK6Ofcz1LHj piifIavLF6C2iRryJZIoJ8v9WJa5wL3m1g1xdtYWDx8Szg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665451948; bh=uK/8+yoylMMONWaQN9ln2MOxMHBTPLycBYsLs6NJy/c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=j/EeNbnUeBPHVqQbqZWVoJJcDfnd3etDdHL4aYReimjCPWEO90qp+AX1GINFGvx2uc7WIfSHlN bXw8Kf7m4DGIy92V01mb2xGJvsXyU2E29/+ikXHFAQpz4+lcxeeNxVmB+rxCEEcosBYQbk5idD Sz2d6n9FvgsN/p93uqKfYV+wbD/3r5wUoIuzuyppfXFvzdtYZtiwfIfMCnxxVIH3IERh+BEg/v SlySLNeBZZkFIwvMosntnUeeWHkRsGi/e5N2WcXLeAD+queyX7MyPQtYCBzwUahqqIHPJ09tZB DQQkxiTRUnlxYTC1cu6bYFNLIQ7vcEEKR+QQZlR4cXGE8A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=uK/8+yoylMMONWaQN9ln2MOxMHBTPLycBYsLs6NJy/c=; b=EKGtO4JoC8/KWrC2PHDVftmBiM pJ1LQK+94ywDMU/j2U377/Tbko8ExStDrXkrO0BOxu+V2H4vCixiiIKydCWujYKibnUpYSSYhlm+y +xww/xqQLh0L7I4G8fuR0GHixNxf+6866Uj38gy9rcoW2YP6XUFZ7nsZbIcssErzHvNJQ1bH45lBB ir20yJVKtV9AsI9q053Dr/tSLsY/jNHeH1xEYFA4QFxzrtxB+U+3IJnJ1qLGjNMRD0PrYGhn1Cyi3 lfElpIDie3z5MY1xam6vx9wnSjt3lztf1ahDcE+HIUdEGUPUQqDn44CfAyIgiC2z5+j1gVMQ8LM0i UHKDyOUA==; Received: by zero.zsh.org with local id 1oi48C-000HuU-3v; Tue, 11 Oct 2022 01:32:28 +0000 Authentication-Results: zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none Received: from iris.zentaur.org ([198.58.127.206]:41100) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oi47w-000HZH-Il; Tue, 11 Oct 2022 01:32:13 +0000 Received: from iris.zentaur.org (localhost [127.0.0.1]) by iris.zentaur.org (Postfix) with ESMTP id 4MmdYl4CqNz3wZj for ; Tue, 11 Oct 2022 01:32:11 +0000 (UTC) Authentication-Results: iris.zentaur.org (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=zentaur.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zentaur.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:references:to:content-language:subject:subject :user-agent:mime-version:date:date:message-id; s=dkim20200120; t=1665451931; x=1665455532; bh=uK/8+yoylMMONWaQN9ln2MOxMHBTPLyc BYsLs6NJy/c=; b=zyntB8LoUURN6k4F4hIPoZUIzTmWXZoq1UVJDXxhnzvMZUWz EDbcXf41LV22ghAfH9OzpxPUaUVChY9KWSp0Ehk2hTcGQDvdRgfWau2BLkXTNV3Y nOnEKz9hNXQEe3GyBwTyRCOYoNRMLshUX1X+AJht143QgG6rYhy7BOnOQkimF7vg zRabXDMNZ3ywS5nC2bAAe4UDYeowWRbBJCxQXvLX9HEOuw66GyPC3TAYrdACqE+r y2D/45JwiavkopPWenR8nvJfiXt668xCWww/dMVuJ67/KuOChf/kPAfKwxdoPBQT V4opBCzrUzetR4R4VRZ/lT40BzFM7uuIPpO2fA== X-Virus-Scanned: amavisd-new at iris.zentaur.org Received: from iris.zentaur.org ([127.0.0.1]) by iris.zentaur.org (iris.zentaur.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RtoA-riG5GSg for ; Tue, 11 Oct 2022 01:32:11 +0000 (UTC) Received: from [192.168.72.136] (unknown [136.50.213.220]) by iris.zentaur.org (Postfix) with ESMTPSA id 4MmdYl0nGhz3wZb for ; Tue, 11 Oct 2022 01:32:11 +0000 (UTC) Message-ID: Date: Mon, 10 Oct 2022 20:32:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: use of rand() in zsh Content-Language: en-US To: zsh-workers@zsh.org References: From: Clinton Bunch In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-Antivirus: Avast (VPS 221010-10, 10/10/2022), Outbound message X-Antivirus-Status: Clean Content-Transfer-Encoding: quoted-printable X-Seq: 50774 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 10/10/2022 8:27 PM, Clinton Bunch wrote: > On 10/10/2022 8:14 PM, Bart Schaefer wrote: >> On Mon, Oct 10, 2022 at 4:38 PM Clinton Bunch =20 >> wrote: >>> Is there a reason that zsh goes out of the way (srand_deterministic) = to >>> use the least random "random" function on modern Unix? >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The values of RANDOM form an intentiona= lly-repeatable=20 >> pseudo-random >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sequence; subshells that reference RAND= OM will result in identical >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pseudo-random values unless the value o= f RANDOM is referenced or >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 seeded in the parent shell in between s= ubshell invocations. >> >> This is e.g. so you aren't surprised by referencing $RANDOM inside >> $(...) and getting a different result. > > Well, I guess that explains why it uses rand, but doesn't really=20 > explain to me why you'd *want* this behavior.=C2=A0 I would expect to g= et a=20 > different value in a subshell than I got in the parent shell.=C2=A0 I'm= =20 > supposedly looking for random numbers. > > =C2=A0I guess I side with OpenBSD who changed the default behavior of r= and(). > > I wonder if it wouldn't be worthwhile to create a module that gave=20 access to better sources of random numbers on the systems that support th= em.