Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] dynamic groups and users
Date: Fri, 02 Aug 2019 16:34:05
Message-Id: CAJ0EP43mmbzaWLUv0OsTEmKQL9m9gyDzT2zHQ_x8Z9+h7yUvXA@mail.gmail.com
In Reply to: Re: [gentoo-dev] dynamic groups and users by Mike Gilbert
1 On Thu, Aug 1, 2019 at 4:01 PM Mike Gilbert <floppym@g.o> wrote:
2 > If you're feeling crazy, this will get you a random assignment between
3 > 1 and 999, with the same fallback logic.
4 >
5 > ACCT_GROUP_ID=$(( RANDOM % 998 + 1 ))
6
7 Correction: this is actually off by one. RANDOM % 999 will give a
8 number between 0 and 998, and RANDOM % 999 + 1 will give 1 to 999.