<br><div class="gmail_quote">On Wed, Oct 13, 2010 at 16:40, Bowie Bailey <span dir="ltr"><<a href="mailto:Bowie_Bailey@buc.com">Bowie_Bailey@buc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"> On 10/13/2010 4:22 PM, Terry Polzin wrote:<br>
> On Wed, 2010-10-13 at 20:09 +0000, Joseph L. Casale wrote:<br>
>>> Is there an equivalent in CentOS?<br>
>> cat /etc/passwd |cut -d ":" -f 3 |sort -n NEXTUID=`expr $LASTUID + 1`<br>
>><br>
>> ;)<br>
</div><div class="im">> LASTUID=`cat /etc/passwd |grep -v nologin|cut -d ":" -f 3 |sort -n |<br>
> tail -1`; NEXTUID=`expr $LASTUID + 1`; echo $NEXTUID<br>
<br>
</div>That assumes the highest UID number has a login shell...<br>
<br>
--<br>
<font color="#888888">Bowie<br>
</font><div><div></div><div class="h5"></div></div></blockquote></div><div><br></div>This also does not tell me how useradd knows that on this system at this time the highest UID assigned to a user is 20015. It will assign 20016 to the next user even though some dim bulb gave a use a UID of 4294967294 (how the hell that user can log in with a UID out of range is beyond me unless it gets truncated)...<div>

I have been able to use things like these 2 examples (cat /etc/passwd | cut -d: -f3 | sort -n | tail -2 | head -1 in this case) but I want to get the next UID from the system not by parsing /etc/passwd</div><div>John<br clear="all">

<br>-- <br> John Kennedy<br><br>
</div>