<?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: Script File for /etc/password in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194744#M792041</link>
    <description>Thanks Sri and sorry for the duplicate post.&lt;BR /&gt;&lt;BR /&gt;I am going to try it and give you my feed back. Your script looks very good. Thanks for all who repond to my post.&lt;BR /&gt;&lt;BR /&gt;Abu</description>
    <pubDate>Wed, 18 Feb 2004 11:43:59 GMT</pubDate>
    <dc:creator>A Sassi</dc:creator>
    <dc:date>2004-02-18T11:43:59Z</dc:date>
    <item>
      <title>Script File for /etc/password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194740#M792037</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I am new at scripting and need help??&lt;BR /&gt;I need to modify /etc/password file and compare the username to the username in a flat file if it finds it then replace the comments field in /etc/pasword and populated from a flat file with this string Ex. "C-137h 897 Abu Sassi (HP)".&lt;BR /&gt;&lt;BR /&gt;Thanks for your help in Advance&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2004 17:23:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194740#M792037</guid>
      <dc:creator>A Sassi</dc:creator>
      <dc:date>2004-02-17T17:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script File for /etc/password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194741#M792038</link>
      <description>The attached script provides you a basis for doing all kinds of things witht he passwd file.&lt;BR /&gt;&lt;BR /&gt;Test it out first on a copy though.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 17 Feb 2004 17:27:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194741#M792038</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-02-17T17:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script File for /etc/password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194742#M792039</link>
      <description>Thanks SEP for your prompt response.&lt;BR /&gt;I am actually looking for a script to modify the field in /etc/password file by parsing a flat file.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;Abu&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2004 17:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194742#M792039</guid>
      <dc:creator>A Sassi</dc:creator>
      <dc:date>2004-02-17T17:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script File for /etc/password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194743#M792040</link>
      <description>Hi Abu,&lt;BR /&gt;&lt;BR /&gt;You can wait to see other responses. The caveat with chfn function is that it will put blanks with commas for the missing fields. Make sure to *take a backup* of your /etc/passwd file. Also make sure you are only the one working on the system as an administrator during this time. Create a file called 'infile' (changeable) in the following format&lt;BR /&gt;&lt;BR /&gt;user1: C-137h 897 Abu Sassi (HP)&lt;BR /&gt;user2: Someone else &lt;BR /&gt;user3: bla bla bla&lt;BR /&gt;&lt;BR /&gt;Make sure you don't have a ":" anywhere other than as the seperator itself.&lt;BR /&gt;&lt;BR /&gt;//start of script&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;PASSWD=/etc/passwd&lt;BR /&gt;MYFILE=infile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;USER=$(echo $LINE|awk '{FS=":";print $1}')&lt;BR /&gt;GECOS=$(echo $LINE|awk '{FS=":";print $2}')&lt;BR /&gt;&lt;BR /&gt;printf "%-20s" "Doing for $USER"&lt;BR /&gt;grep -q "^${USER}:" $PASSWD&lt;BR /&gt;&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;then&lt;BR /&gt;chfn $USER &amp;lt;&amp;lt; EOF &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;none&lt;BR /&gt;none&lt;BR /&gt;none&lt;BR /&gt;$GECOS&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;printf "- Done\n"&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;printf "- N/A\n"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; $MYFILE&lt;BR /&gt;&lt;BR /&gt;// end of script&lt;BR /&gt;&lt;BR /&gt;Once the script is run, you can replace ":,,," by editing the passwd file with the command 'vipw' and %s:/:,,,/:/g macro.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 17 Feb 2004 19:04:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194743#M792040</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-02-17T19:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script File for /etc/password</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194744#M792041</link>
      <description>Thanks Sri and sorry for the duplicate post.&lt;BR /&gt;&lt;BR /&gt;I am going to try it and give you my feed back. Your script looks very good. Thanks for all who repond to my post.&lt;BR /&gt;&lt;BR /&gt;Abu</description>
      <pubDate>Wed, 18 Feb 2004 11:43:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-file-for-etc-password/m-p/3194744#M792041</guid>
      <dc:creator>A Sassi</dc:creator>
      <dc:date>2004-02-18T11:43:59Z</dc:date>
    </item>
  </channel>
</rss>

