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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19902 invoked from network); 25 Feb 2023 23:03:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Feb 2023 23:03:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1677366213; b=cHKphETOrap6tmgDD6ye3lMeSK/7XADzPQH47SDcEULZDCqsjydN2ccf0tiMotSFTlgxBbhT5S g3yZkqp+hGRAxB5Phzlx3rrbtXvnYQ1gXLvAoJZAjrA7QM5BAzzWDa/tJ0+mFwcl/KZl4JCCAV BichjzMVraB4nQQyk1vvklXuwikUetZ3zcUg0jmgmAAsMnNt0M8XJQMgjv3hBYiAbWGnV7jBk2 r2JPNNQAcTQTkqUC8QY1bIkdQz405tVwGHkl/JxOHrt9ulmbdM+ndUwvx1GAln6rrHBbqCdT0i 20lMj88WaxsvVRjisYBXK1a9TK0mNYXVlzziCWXaZYA8Hw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (b224-10.smtp-out.eu-central-1.amazonses.com) smtp.remote-ip=69.169.224.10; dkim=pass header.d=sheogorath.shivering-isles.com header.s=7vylrxara6xm4rfbfjtglttbnpszd6mn header.a=rsa-sha256; dkim=pass header.d=amazonses.com header.s=sokbgaaqhfgd6qjht2wmdajpuuanpimv header.a=rsa-sha256; dmarc=none header.from=sheogorath.shivering-isles.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1677366213; bh=ll/7OAwhc9pvIZQMPTjwBpO6YDOkXmDc3OuE/aXkdfk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:MIME-Version:Content-Transfer-Encoding:Content-Type:Date:To: From:Subject:Message-ID:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=TPsOiuWi4E0jmumTyozUitlicydOs0PdbUpgXPpmkVuodhw5oCnfgJTEFNLA33wegpZ+Cagr2J aatIsGpLq8oAvlu3p0sEzOo/FXucH275xFUwjXGdLWYY5QOXX1BXCykSDrl5AIn0ZnWrGQKadg AD8A22Ns2IHQsK9cRSrDIgQ6d7MzDe1vA6VHtHh1nha4cIQFgqwIuroDUdG9rjdoh9z+ATperO 6HqL4xC9ZZDrsh81VDuyjM2P1oZI+3+gknpUc0QMpb0iQuX+yGmS0ki0GAEujzp8avqqMrd/hF i6sqvm2kpDGlAo5lU58AWdyx6tIu7tNFJcoltYo2OTv13w==; 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:MIME-Version: Content-Transfer-Encoding:Content-Type:Date:To:From:Subject:Message-ID: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=2hoU6Rtk1k6XUG5lUatCN8ahnDFGeEXNxJWDf2sqLV0=; b=d6McluVg0A69++7fW7zlqH6RPt yKh9qhzPvrgh0MVCpHXH4AqSa8Cw45yOygr9Kuen0nkciBRqXwvgbx2+oxFmt6qSXxgzhzszG+NFg sRTpBRMmBPt+r0qCtPVq834/qcnHRc1fTMq2XESgZIEYR+7LDmFeImMjAXTTP7lPrRZBezlv6qzSN 7hP9H6i9UAr2I4V4KqYHkBNJkTNw6JlaxZoOBc1ZPB6835N3eg7RtqaCfcMUIXlSLWmOM/jv21R/y N5RDklNK7z+WOTF6Ctw9mig2c9FXbyAlJVChTpZhguhXgdExDPB51S92v5yBqUI7eKhvNAXgEdmDd +Ou8KPzg==; Received: by zero.zsh.org with local id 1pW3Zk-000ED2-Mj; Sat, 25 Feb 2023 23:03:32 +0000 Authentication-Results: zsh.org; iprev=pass (b224-10.smtp-out.eu-central-1.amazonses.com) smtp.remote-ip=69.169.224.10; dkim=pass header.d=sheogorath.shivering-isles.com header.s=7vylrxara6xm4rfbfjtglttbnpszd6mn header.a=rsa-sha256; dkim=pass header.d=amazonses.com header.s=sokbgaaqhfgd6qjht2wmdajpuuanpimv header.a=rsa-sha256; dmarc=none header.from=sheogorath.shivering-isles.com; arc=none Received: from b224-10.smtp-out.eu-central-1.amazonses.com ([69.169.224.10]:54943) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-SHA256:128) id 1pW3ZA-000Dtb-PK; Sat, 25 Feb 2023 23:02:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=7vylrxara6xm4rfbfjtglttbnpszd6mn; d=sheogorath.shivering-isles.com; t=1677366175; h=Message-ID:Subject:From:To:Date:Content-Type:Content-Transfer-Encoding:MIME-Version; bh=ll/7OAwhc9pvIZQMPTjwBpO6YDOkXmDc3OuE/aXkdfk=; b=biYPt/D//1dx8H21qAWvGMc/t4OuDglwBRC7Nowb+sXZfnbp/Ov0g0RwJhTEDY+a Mu04sIJx/lEHb1T+AnuReMRlwWOe7rKyEZiudOxkT5gNDo90oKAPZXWlffYJiL0SBrc QVUhgQLRaUK5vYAVDSTx8CzMJSFkU+lvTwzeC2+suk9YtiUiiPf8Cc8wLktfn1raD0p 3zbZwXNNXXTzmixaccNjDBXyvTMzDZF2SiQJ4EFZuEhC56z4gMU47Zsscr4t4lfEstm DhPM6+cGl2ha8X9aluhunk8onoHcuoRYz8mnGmA4YJ8xnvzivMDf6fWwTV2GNHSHi5A mGjFwuaF2Q== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=sokbgaaqhfgd6qjht2wmdajpuuanpimv; d=amazonses.com; t=1677366175; h=Message-ID:Subject:From:To:Date:Content-Type:Content-Transfer-Encoding:MIME-Version:Feedback-ID; bh=ll/7OAwhc9pvIZQMPTjwBpO6YDOkXmDc3OuE/aXkdfk=; b=J0SKDNmCMbIKs95N6v6qwqsOz1UivQCMbO8TiJ/4iKHLimBUOakLgdRTfrChKL/e 1rJ2R2PRRuc3XyN2QK1YcI/eA5lhCn/AloEz6sImBJ3lXobaKls+JKN74rUJ9F2Blrl Uqo6RuiNH71FizCpaUuMVgSucNyR6UzZRi1Jp0Hs= Message-ID: <010701868ad0a7e8-be8c1ddd-a63c-4002-926a-b7ba25a0cebb-000000@eu-central-1.amazonses.com> Subject: Bug report: Strange behaviour with random, sort and uniq From: Sheogorath To: zsh-workers@zsh.org Date: Sat, 25 Feb 2023 23:02:55 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 Feedback-ID: 1.eu-central-1.xpHyXi0Gn6udT8dq66O1NgFCpD0sp/inS5fRAuWSdFQ=:AmazonSES X-SES-Outgoing: 2023.02.25-69.169.224.10 X-Seq: 51479 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: Hello ZSH maintainers, I found a quite strange bug in my current installation. I tried to do some virtual dice flips and something strange appeared. I was running the following command in a terminal: for i in $(seq 0 100); do echo $((1 + RANDOM % 6)); done | sort | uniq -c When run twice after each other, it produces the same output: Example: $ for i in $(seq 0 100); do echo $((1 + RANDOM % 6)); done | sort | uniq -c 12 1 17 2 22 3 19 4 16 5 15 6 $ for i in $(seq 0 100); do echo $((1 + RANDOM % 6)); done | sort | uniq -c 12 1 17 2 22 3 19 4 16 5 15 6 However, this changes, as soon as one run the command without the 'sort | uniq -c' piping: for i in $(seq 0 100); do echo $((1 + RANDOM % 6)); done Next time, the output of 'for i in $(seq 0 100); do echo $((1 + RANDOM % 6)); done | sort | uniq -c' will be different. When redirecting the output of the command into files, these are also different. Since all of this was so strange, I reproduced it on Fedora 36 in a container (using zsh -f) as well as on my Fedora 37 host. Also in a VM, with a fresh Fedora 37 install on Hetzner and a Debian 10 install, to make sure, it's not due to a distro specific modification. I also validated, that this behaviour doesn't exist in bash. I hope you'll have fun debugging it, I have no idea where to even start. Greetings Sheogorath