<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: useradd command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083182#M143135</link>
    <description>do the following in your script.&lt;BR /&gt;&lt;BR /&gt;useradd -u $(expr $(cat /etc/passwd|cut -d ':' -f3|sort -n|tail -1) + 1) ....&lt;BR /&gt;&lt;BR /&gt;This will find the largest number in your /etc/passwd file and add one to it, then pass that value on to useradd.  I do the same thing here.  Of course this only does a one up.  It will not fill in any empty spaces that are less then the max uid.&lt;BR /&gt;&lt;BR /&gt;--Jim&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 01 Oct 2003 14:45:36 GMT</pubDate>
    <dc:creator>James Specht</dc:creator>
    <dc:date>2003-10-01T14:45:36Z</dc:date>
    <item>
      <title>useradd command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083181#M143134</link>
      <description>I am trying to build a scrict that adds ftpusers.  I am using the useradd command but I want to set the UID to use the next available over 1000.  can this be done?&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2003 14:36:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083181#M143134</guid>
      <dc:creator>matthew mills</dc:creator>
      <dc:date>2003-10-01T14:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: useradd command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083182#M143135</link>
      <description>do the following in your script.&lt;BR /&gt;&lt;BR /&gt;useradd -u $(expr $(cat /etc/passwd|cut -d ':' -f3|sort -n|tail -1) + 1) ....&lt;BR /&gt;&lt;BR /&gt;This will find the largest number in your /etc/passwd file and add one to it, then pass that value on to useradd.  I do the same thing here.  Of course this only does a one up.  It will not fill in any empty spaces that are less then the max uid.&lt;BR /&gt;&lt;BR /&gt;--Jim&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2003 14:45:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083182#M143135</guid>
      <dc:creator>James Specht</dc:creator>
      <dc:date>2003-10-01T14:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: useradd command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083183#M143136</link>
      <description>Add this line to your script:&lt;BR /&gt;cut -d: -f3 passwd | sort -n | awk -f nextuid.awk  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;nextuid.awk should contain:&lt;BR /&gt;-------------------------------------&lt;BR /&gt;BEGIN {previd=1000;}&lt;BR /&gt;$1&amp;gt;1000 {&lt;BR /&gt;         if ($1-previd &amp;gt; 1)&lt;BR /&gt;           {print previd+1; exit;}&lt;BR /&gt;         previd=$1;&lt;BR /&gt;        }&lt;BR /&gt;----------------------------------------&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Kent M. Ostby&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2003 14:51:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/useradd-command/m-p/3083183#M143136</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2003-10-01T14:51:58Z</dc:date>
    </item>
  </channel>
</rss>

