<?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 Help. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747934#M944745</link>
    <description>Unless I'm much mistaken you are trying to copy the /etc/passwd file to all the slaves... You do not need to do this if you have nis yp_xfr (I think) can do it or just re-make the NIS DB &amp;amp; the passwd file will be exported to all the slaves (ypmake)&lt;BR /&gt;&lt;BR /&gt;tim</description>
    <pubDate>Wed, 19 Jun 2002 15:24:13 GMT</pubDate>
    <dc:creator>Tim D Fulford</dc:creator>
    <dc:date>2002-06-19T15:24:13Z</dc:date>
    <item>
      <title>Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747931#M944742</link>
      <description>Hi All:&lt;BR /&gt;&lt;BR /&gt; We have a script to push the homedir's for nis and runs on the master server. There is this portion of the code i am having problem with. It reads a hosfile and pushes the dir's to them. This is the hostfile&lt;BR /&gt;&lt;BR /&gt;MASTER=tx274&lt;BR /&gt;SLAVE1=tx275&lt;BR /&gt;SLAVE2=tx276&lt;BR /&gt;SLAVE3=tx277&lt;BR /&gt;I have attached the portion of the script which does the pushing of the dir's which doesn't function. I think this was written with one SLAVE entry in the above hostfile.now we have 3 entries. Can someone help please?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Joe.&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 15:07:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747931#M944742</guid>
      <dc:creator>joe_91</dc:creator>
      <dc:date>2002-06-19T15:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747932#M944743</link>
      <description>Hi Joe,&lt;BR /&gt;&lt;BR /&gt;Try this changes:&lt;BR /&gt;&lt;BR /&gt;for cur_line in hostfile |&lt;BR /&gt;   do&lt;BR /&gt;      if `echo ${cur_line} | grep "^SLAVE" &amp;gt; /dev/null`&lt;BR /&gt;          then&lt;BR /&gt;         SLAVE=`echo ${cur_line}| cut -d"=" -f2`&lt;BR /&gt;         remsh ${SLAVE} hostname &amp;gt; /dev/null&lt;BR /&gt;         if test $? -eq 0&lt;BR /&gt;         then&lt;BR /&gt;            echo "Copying password file to the Slave - $SLAVE."&lt;BR /&gt;            rcp ${PASSWD} ${SLAVE}:${PASSWD}&lt;BR /&gt;         else&lt;BR /&gt;            echo "\n\n\t\tUnable to reach the Slave - ${SLAVE}.\n\n"&lt;BR /&gt;         fi&lt;BR /&gt;      fi&lt;BR /&gt;   done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Wed, 19 Jun 2002 15:16:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747932#M944743</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-06-19T15:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747933#M944744</link>
      <description>Hi Again,&lt;BR /&gt;&lt;BR /&gt;Sorry a mistake:&lt;BR /&gt;for cur_line in hostfile | &lt;BR /&gt;do &lt;BR /&gt;&lt;BR /&gt;This is the good lines:&lt;BR /&gt;for cur_line in hostfile&lt;BR /&gt;do &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Wed, 19 Jun 2002 15:18:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747933#M944744</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-06-19T15:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747934#M944745</link>
      <description>Unless I'm much mistaken you are trying to copy the /etc/passwd file to all the slaves... You do not need to do this if you have nis yp_xfr (I think) can do it or just re-make the NIS DB &amp;amp; the passwd file will be exported to all the slaves (ypmake)&lt;BR /&gt;&lt;BR /&gt;tim</description>
      <pubDate>Wed, 19 Jun 2002 15:24:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747934#M944745</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2002-06-19T15:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747935#M944746</link>
      <description>Here's my version&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;PASWD=/etc/passwd&lt;BR /&gt;&lt;BR /&gt;for line in $(cat hostfile)&lt;BR /&gt;do&lt;BR /&gt;        slaveyn=$(echo $line | awk -F"=" 'BEGIN{f=0}; $1=/SLAVE/{f=1}; END{print&lt;BR /&gt; f}')&lt;BR /&gt;        host=$(echo $line | cut -d"=" -f2)&lt;BR /&gt;        if [ $slaveyn -eq 1 ]&lt;BR /&gt;        then&lt;BR /&gt;                remsh $host /usr/bin/hostname &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;                if [ $? -eq 0 ]&lt;BR /&gt;                then&lt;BR /&gt;                        echo "Copying password file to slave - $host"&lt;BR /&gt;                        rcp ${PASWD} $host:${PASWD}&lt;BR /&gt;                else&lt;BR /&gt;                        echo "unable to reach slave $host"&lt;BR /&gt;                fi&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Tim</description>
      <pubDate>Wed, 19 Jun 2002 15:30:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747935#M944746</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2002-06-19T15:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747936#M944747</link>
      <description>I too made a mistake (I wasn't going to test it copying 'round passwd files!!!)&lt;BR /&gt;&lt;BR /&gt;in awk statement I mean ... $1~/SLAVE/{.... not =&lt;BR /&gt;&lt;BR /&gt;Tim</description>
      <pubDate>Wed, 19 Jun 2002 15:33:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747936#M944747</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2002-06-19T15:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747937#M944748</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;  I am still getting only tx277 as $SLAVE. Will that help. I think it should capture all the 3 slaves and that was the problem.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Joe.</description>
      <pubDate>Wed, 19 Jun 2002 15:52:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747937#M944748</guid>
      <dc:creator>joe_91</dc:creator>
      <dc:date>2002-06-19T15:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747938#M944749</link>
      <description>&lt;BR /&gt;Try this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;grep ^SLAVE hostfile | while IFS='=' read junk slave comment&lt;BR /&gt;do&lt;BR /&gt;        if remsh $slave hostname 0&amp;lt;&amp;amp;- 1&amp;gt;&amp;amp;2&lt;BR /&gt;        then&lt;BR /&gt;                echo "Copying password file to slave $slave."&lt;BR /&gt;        else&lt;BR /&gt;                echo "Unable to reach slave $slave."&lt;BR /&gt;        fi&lt;BR /&gt;done 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Notice that we are closing stdin to remsh; Otherwise it will slurp up the rest of the grep stream.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 17:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747938#M944749</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-06-19T17:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747939#M944750</link>
      <description>&lt;BR /&gt;Oh, I forgot the `rcp /etc/passwd ${slave}:/etc/passwd` part... Sorry.</description>
      <pubDate>Wed, 19 Jun 2002 17:25:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2747939#M944750</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-06-19T17:25:42Z</dc:date>
    </item>
  </channel>
</rss>

