<?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: Looking for specific user ID's from the passwd file in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059993#M94484</link>
    <description>Something like:&lt;BR /&gt;&lt;BR /&gt;grep [a-z][a-z][0-9][0-9][0-9][0-9] userids.txt&lt;BR /&gt;&lt;BR /&gt;should work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Fri, 24 Aug 2007 10:31:41 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2007-08-24T10:31:41Z</dc:date>
    <item>
      <title>Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059989#M94480</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;My issue is that I want to look for specific userids that have their first and last characters are alphabetic followed by four numbers. &lt;BR /&gt;&lt;BR /&gt;I've already got the user ID's out of the passwd file:&lt;BR /&gt;&lt;BR /&gt;more passwd | awk -F ":" '{print $1}' &amp;gt; userids.txt&lt;BR /&gt;&lt;BR /&gt;I just need to know how to just pick the users out of the list that are formated:&lt;BR /&gt;&lt;BR /&gt;aannnn&lt;BR /&gt;&lt;BR /&gt;a=alphabet&lt;BR /&gt;n=number&lt;BR /&gt;&lt;BR /&gt;like for example:&lt;BR /&gt;&lt;BR /&gt;ab1234&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Aug 2007 10:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059989#M94480</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2007-08-24T10:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059990#M94481</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;awk has a print format function called printf&lt;BR /&gt;&lt;BR /&gt;Take a look at that and you can do pattern matching.&lt;BR /&gt;&lt;BR /&gt;You may also be able to use grep as a pre or post processor for this script.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 24 Aug 2007 10:30:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059990#M94481</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-08-24T10:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059991#M94482</link>
      <description># grep '^[a-z]\{2\}[0-9]\{4\}$' infile</description>
      <pubDate>Fri, 24 Aug 2007 10:31:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059991#M94482</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-08-24T10:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059992#M94483</link>
      <description>Hi Patric:&lt;BR /&gt;&lt;BR /&gt;# perl -aF":" -nle 'print $F[0] if $F[0]=~/[A-Za-z]+\d{4}$/' /etc/passwd&lt;BR /&gt;&lt;BR /&gt;That is, split the field of the file on the ":" delimiter.  If the first (zero-relative) field consists of one or more letters followed by exactly 4-digits, print the userid.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Aug 2007 10:31:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059992#M94483</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-24T10:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059993#M94484</link>
      <description>Something like:&lt;BR /&gt;&lt;BR /&gt;grep [a-z][a-z][0-9][0-9][0-9][0-9] userids.txt&lt;BR /&gt;&lt;BR /&gt;should work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 24 Aug 2007 10:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059993#M94484</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2007-08-24T10:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059994#M94485</link>
      <description>Hi (again) Patrick:&lt;BR /&gt;&lt;BR /&gt;Steven &amp;gt; awk has a print format function called printf.  Take a look at that and you can do pattern matching&lt;BR /&gt;&lt;BR /&gt;Hardly, 'printf' does formatted printing not pattern matching.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Aug 2007 10:34:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059994#M94485</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-24T10:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059995#M94486</link>
      <description>Pete's anwser was the closest:&lt;BR /&gt;&lt;BR /&gt;I ended up doing this:&lt;BR /&gt;&lt;BR /&gt;more passwd | awk -F ":" '{print $1}' | grep '[A-Za-z][A-Za-z][0-9][0-9][0-9][0-9]'</description>
      <pubDate>Fri, 24 Aug 2007 10:41:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059995#M94486</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2007-08-24T10:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059996#M94487</link>
      <description>Yet another way to do it using awk(1):&lt;BR /&gt;&lt;BR /&gt;# awk -F: '$1~"[a-z]{2}[0-9]{4}"{print $1}' /etc/passwd&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Fri, 24 Aug 2007 10:45:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059996#M94487</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-08-24T10:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059997#M94488</link>
      <description>Hi Patrick:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;  ended up doing this:&lt;BR /&gt;&lt;BR /&gt;# more passwd | awk -F ":" '{print $1}' | grep '[A-Za-z][A-Za-z][0-9][0-9][0-9][0-9]'&lt;BR /&gt;&lt;BR /&gt;That's a waste of two processes!  Let 'awk' open and read the file instead of having 'cat' or 'more' spawn 'awk'.  Then, let 'awk' do the matching that it was designed to do, eliminating the 'grep':&lt;BR /&gt;&lt;BR /&gt;# awk -F":" '/[A-Za-z][A-Za-z][0-9][0-9][0-9][0-9]/ {print $1}' /etc/passwd&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Aug 2007 10:49:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059997#M94488</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-24T10:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059998#M94489</link>
      <description>Ignore last post and use the one below as it anchors the regular expression:&lt;BR /&gt;&lt;BR /&gt;# awk -F: '$1~"^[a-z]{2}[0-9]{4}$"{print $1}' file&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Fri, 24 Aug 2007 10:56:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059998#M94489</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-08-24T10:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for specific user ID's from the passwd file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059999#M94490</link>
      <description>Thanks guys!</description>
      <pubDate>Fri, 24 Aug 2007 11:14:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/looking-for-specific-user-id-s-from-the-passwd-file/m-p/4059999#M94490</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2007-08-24T11:14:21Z</dc:date>
    </item>
  </channel>
</rss>

