<?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: replacing text in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550338#M27997</link>
    <description>Hi Donna,&lt;BR /&gt;&lt;BR /&gt;On the earlier releases of HP-UX passwd -l is not available. I had a script that was very close and spent about two minutes adapting it to your needs. The final copy of the temp file to /etc/passwd is commented out for testing.&lt;BR /&gt;&lt;BR /&gt;Use it like this: clobber user1 user2 ...&lt;BR /&gt;&lt;BR /&gt;It will place an * in the passwd field of user1 user2 ...; there is a value min_uid (100). No change will be made to a user with a UID less than this value. You can set it to another value.&lt;BR /&gt;&lt;BR /&gt;Whenever you are manipulating the passwd file like this, make sure that you make a safe copy of the passwd file and be logged in as root in two sessions. TYou are then able to extricate yourself from a problem as fast as you got yourseld in it.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
    <pubDate>Mon, 09 Jul 2001 16:59:21 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-07-09T16:59:21Z</dc:date>
    <item>
      <title>replacing text</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550335#M27994</link>
      <description>I am in the process of writing a script to replace the encrypted passwd in the passwd file with an asterik.  So far I have only been able to grep this information from the passwd file using grep inconjunction with the awk command, but I can't figure out how to replace this information with an asterik.  Any help will be appreciated.</description>
      <pubDate>Mon, 09 Jul 2001 15:44:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550335#M27994</guid>
      <dc:creator>Donna Powell</dc:creator>
      <dc:date>2001-07-09T15:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550336#M27995</link>
      <description>&lt;BR /&gt;`passwd -l &lt;USERNAME&gt;` does this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Mon, 09 Jul 2001 15:57:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550336#M27995</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2001-07-09T15:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550337#M27996</link>
      <description>I agree, I would use the -l option. &lt;BR /&gt;&lt;BR /&gt;However, if you wish to use sed.&lt;BR /&gt;&lt;BR /&gt;first, you would have to cut -f2 of the passwd file for the user (lets say $var1) then&lt;BR /&gt;&lt;BR /&gt;cat /etc/passwd | sed 's/$var1/\*/' &amp;gt; /etc/passwd.tmp&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;mv /etc/passwd.tmp /etc/passwd&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Mon, 09 Jul 2001 16:21:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550337#M27996</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-07-09T16:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550338#M27997</link>
      <description>Hi Donna,&lt;BR /&gt;&lt;BR /&gt;On the earlier releases of HP-UX passwd -l is not available. I had a script that was very close and spent about two minutes adapting it to your needs. The final copy of the temp file to /etc/passwd is commented out for testing.&lt;BR /&gt;&lt;BR /&gt;Use it like this: clobber user1 user2 ...&lt;BR /&gt;&lt;BR /&gt;It will place an * in the passwd field of user1 user2 ...; there is a value min_uid (100). No change will be made to a user with a UID less than this value. You can set it to another value.&lt;BR /&gt;&lt;BR /&gt;Whenever you are manipulating the passwd file like this, make sure that you make a safe copy of the passwd file and be logged in as root in two sessions. TYou are then able to extricate yourself from a problem as fast as you got yourseld in it.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Mon, 09 Jul 2001 16:59:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550338#M27997</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-07-09T16:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550339#M27998</link>
      <description>Thanks UNIX friends.  I'll try the passwd -l command</description>
      <pubDate>Mon, 09 Jul 2001 17:31:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550339#M27998</guid>
      <dc:creator>Donna Powell</dc:creator>
      <dc:date>2001-07-09T17:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550340#M27999</link>
      <description>Hi Donna:&lt;BR /&gt;&lt;BR /&gt;How about this:&lt;BR /&gt;&lt;BR /&gt;awk -F: 'BEGIN {OFS=":"};{if ($3&amp;gt;=100 &amp;amp;&amp;amp; $2!="*") {$2="*";print $0} else {print $0}}' /etc/passwd &amp;gt; /tmp/passwd&lt;BR /&gt;&lt;BR /&gt;This will preserve UID's less than or equal to 100 but will alter those greater than 100.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 09 Jul 2001 17:40:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text/m-p/2550340#M27999</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-07-09T17:40:15Z</dc:date>
    </item>
  </channel>
</rss>

