<?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: Scripting issue : Can not read the second line in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656761#M241297</link>
    <description>Hi Rac, &lt;BR /&gt;&lt;BR /&gt;Thanks. I have modified it. It still gave me the same problem. &lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
    <pubDate>Tue, 25 Oct 2005 04:35:39 GMT</pubDate>
    <dc:creator>Dewa Negara_4</dc:creator>
    <dc:date>2005-10-25T04:35:39Z</dc:date>
    <item>
      <title>Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656751#M241287</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;I have a simple script using while read command below. When I tried to run it, it only run for first line (bdsn4013        SECU). It can not go to the second line,etc. Anyone can help to tell me what the issue is? &lt;BR /&gt;&lt;BR /&gt;Please help. High score will be given. &lt;BR /&gt;&lt;BR /&gt;Thanks and Best Regards,&lt;BR /&gt;Dewa&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/parmlib]&lt;BR /&gt;# more transfer_sched.dat&lt;BR /&gt;bdsn4013        SECU&lt;BR /&gt;bdsn4002        SECU_QA&lt;BR /&gt;bdsn4014        SECU&lt;BR /&gt;&lt;BR /&gt;-------------------------&lt;BR /&gt;TDIR=/var/tmp&lt;BR /&gt;PARMDIR=/var/opt/secu/parmlib&lt;BR /&gt;DEP=bdhm&lt;BR /&gt;DEPDIR=/usr/local/sysmgr/secu_refresh&lt;BR /&gt;LIST=$PARMDIR/transfer_sched.dat&lt;BR /&gt;LOGDIR=/var/opt/secu/log&lt;BR /&gt;LOG=$LOGDIR/transfer_secu.log&lt;BR /&gt;DATE=`date +%d%m%y`&lt;BR /&gt;&lt;BR /&gt;grep -v "#" $LIST|grep -v "^$"|while read CLN PKG&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;#Test first parameter&lt;BR /&gt;if [ `remsh $CLN uname -s 2&amp;gt; /dev/null|grep -e SunOS -e AIX -e HP-UX |wc -l` -lt 1 ]&lt;BR /&gt;then  echo "$DATE $CLN FAILED Either hostname is incorrect or remsh is not working from bdhp4337." |tee -a $LOG;continue;fi&lt;BR /&gt;&lt;BR /&gt;#Test second parameter&lt;BR /&gt;case $PKG in&lt;BR /&gt; SECU|secu        ) CONF=$PARMDIR/secu.conf ;;&lt;BR /&gt; SECU_QA|secu_qa  ) CONF=$PARMDIR/secu_qa.conf ;;&lt;BR /&gt; SECU_TST|secu_tst) CONF=$PARMDIR/secu_tst.conf ;;&lt;BR /&gt;                 *) echo "$DATE $CLN FAILED Package should be either SECU, SECU_QA, or SECU_TST" |tee -a $LOG;continue ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;mkdir $TDIR/$$.${CLN}_log&lt;BR /&gt;&lt;BR /&gt;N=1&lt;BR /&gt;cat $CONF|grep -v "#"|grep -v "^$" |while read REMDIR TODIR FILE OWNER PERM&lt;BR /&gt;do&lt;BR /&gt;   mkdir $TDIR/$$.${CLN}_log/$N&lt;BR /&gt;   if [ `echo $REMDIR|grep ^"./"|wc -l` -gt 0 ];then FROMDIR=`echo ${DEPDIR}${REMDIR#.}`&lt;BR /&gt;   else FROMDIR=${REMDIR};fi&lt;BR /&gt;&lt;BR /&gt;   #Pull the files from Depot server BDHM&lt;BR /&gt;   rcp -p $DEP:${FROMDIR}/$FILE $TDIR/$$.${CLN}_log/$N &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;   if [ `echo ${OWNER}#` != "#" ]; then chown ${OWNER} $TDIR/$$.${CLN}_log/$N/$FILE;fi &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;   if [ `echo ${PERM}#` != "#" ]; then chmod ${PERM} $TDIR/$$.${CLN}_log/$N/$FILE;fi &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;   #Transfer the files to the client&lt;BR /&gt;   rcp -p $TDIR/$$.${CLN}_log/$N/$FILE $CLN:${TODIR} &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;   ((N=$N + 1))&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#Uncompress files, move to the correct place, etc...&lt;BR /&gt;F1=fn2acf.dat&lt;BR /&gt;F2=appids.dat&lt;BR /&gt;F3=grps.dat&lt;BR /&gt;F4=words&lt;BR /&gt;F5=pmd.tar&lt;BR /&gt;&lt;BR /&gt;remsh $CLN "cd /var/tmp;uncompress $F1 $F2 $F3 $F4;chown root:sys $F1 $F2 $F3 $F4;chmod 644 $F1 $F2 $F3 $F4; \&lt;BR /&gt;            mv $F1 $F2 $F3 $PARMDIR;mv $F4 /usr/dict;rm -f ${F1}.Z ${F2}.Z ${F3}.Z ${F4}.Z; \&lt;BR /&gt;            /usr/bin/tar -xvf /var/opt/secu/$F5;rm -f /var/opt/secu/$F5" &amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;echo "$DATE $CLN COMPLETED" |tee -a $LOG&lt;BR /&gt;&lt;BR /&gt;rm -r $TDIR/$$.${CLN}_log&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 03:28:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656751#M241287</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2005-10-25T03:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656752#M241288</link>
      <description>Is the every line in file seperated by new line??&lt;BR /&gt;&lt;BR /&gt;od -c &amp;lt; your_file</description>
      <pubDate>Tue, 25 Oct 2005 03:35:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656752#M241288</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-25T03:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656753#M241289</link>
      <description>Thanks. &lt;BR /&gt;&lt;BR /&gt;I tried to use both "space" and "tab". Both gave me the same (while read can not go to the second line).&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Dewa&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# ./transfer_secu_DEV.sh&lt;BR /&gt;251005 bdsn4013 COMPLETED&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/parmlib]&lt;BR /&gt;# more transfer_sched.dat&lt;BR /&gt;bdsn4013        SECU&lt;BR /&gt;bdsn4002        SECU_QA&lt;BR /&gt;bdsn4014        SECU&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/parmlib]&lt;BR /&gt;# od -c &amp;lt; transfer_sched.dat&lt;BR /&gt;0000000   b   d   s   n   4   0   1   3  \t   S   E   C   U  \n   b   d&lt;BR /&gt;0000020   s   n   4   0   0   2  \t   S   E   C   U   _   Q   A  \n   b&lt;BR /&gt;0000040   d   s   n   4   0   1   4  \t   S   E   C   U  \n&lt;BR /&gt;0000055&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 03:46:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656753#M241289</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2005-10-25T03:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656754#M241290</link>
      <description>What does following give??&lt;BR /&gt;&lt;BR /&gt;How many lines do you get?? Post.</description>
      <pubDate>Tue, 25 Oct 2005 03:54:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656754#M241290</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-25T03:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656755#M241291</link>
      <description>What does following give??&lt;BR /&gt;grep -v "#" $LIST|grep -v "^$"&lt;BR /&gt;&lt;BR /&gt;Also as follows.&lt;BR /&gt;grep -v "#" $LIST|grep -v "^$"|od -c</description>
      <pubDate>Tue, 25 Oct 2005 03:59:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656755#M241291</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-25T03:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656756#M241292</link>
      <description>Hi Dewa,&lt;BR /&gt; &lt;BR /&gt;I haven't read through your lengthy script to check for any possible errors there.&lt;BR /&gt;But despite I assume it's only the grepping part that reads the input lines.&lt;BR /&gt; &lt;BR /&gt;How about trying something like&lt;BR /&gt; &lt;BR /&gt;grep '^[^#]' $LIST | while read CLN PKG; do&lt;BR /&gt; &lt;BR /&gt;at the beginning?</description>
      <pubDate>Tue, 25 Oct 2005 04:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656756#M241292</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2005-10-25T04:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656757#M241293</link>
      <description>Hi Rac, &lt;BR /&gt;&lt;BR /&gt;Sorry...what you mean?&lt;BR /&gt;&lt;BR /&gt;When I tried to run the script, it only reads the first line. It never goes to the second line. Is there any problem with the config file /var/opt/secu/parmlib/transfer_sched.dat?&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/parmlib]&lt;BR /&gt;# more transfer_sched.dat&lt;BR /&gt;bdsn4013        SECU&lt;BR /&gt;bdsn4002        SECU_QA&lt;BR /&gt;bdsn4014        SECU&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# ./transfer_secu_DEV.sh&lt;BR /&gt;251005 bdsn4013 COMPLETED&lt;BR /&gt;&lt;BR /&gt;Expected result as below:&lt;BR /&gt;# ./transfer_secu_DEV.sh&lt;BR /&gt;251005 bdsn4013 COMPLETED&lt;BR /&gt;251005 bdsn4002 COMPLETED&lt;BR /&gt;251005 bdsn4014 COMPLETED&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 04:03:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656757#M241293</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2005-10-25T04:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656758#M241294</link>
      <description>Hi Rac, &lt;BR /&gt;&lt;BR /&gt;Thanks. Here is the output:&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# PARMDIR=/var/opt/secu/parmlib&lt;BR /&gt;You have mail in /var/mail/root&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# LIST=$PARMDIR/transfer_sched.dat&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# grep -v "#" $LIST|grep -v "^$"&lt;BR /&gt;bdsn4013        SECU&lt;BR /&gt;bdsn4002        SECU_QA&lt;BR /&gt;bdsn4014        SECU&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# grep -v "#" $LIST|grep -v "^$"|od -c&lt;BR /&gt;0000000   b   d   s   n   4   0   1   3  \t   S   E   C   U  \n   b   d&lt;BR /&gt;0000020   s   n   4   0   0   2  \t   S   E   C   U   _   Q   A  \n   b&lt;BR /&gt;0000040   d   s   n   4   0   1   4  \t   S   E   C   U  \n&lt;BR /&gt;0000055&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 04:06:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656758#M241294</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2005-10-25T04:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656759#M241295</link>
      <description>Hi Ralph, &lt;BR /&gt;&lt;BR /&gt;Thanks. It gave me the same result. &lt;BR /&gt;&lt;BR /&gt;grep '^[^#]' $LIST|while read CLN PKG&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;#Test first parameter&lt;BR /&gt;if [ `remsh $CLN uname -s 2&amp;gt; /dev/null|grep -e SunOS -e AIX -e HP-UX |wc -l` -lt 1 ]&lt;BR /&gt;then  echo "$DATE $CLN FAILED Either hostname is incorrect or remsh is not working from bdhp4337." |tee -a $LOG;continue;fi&lt;BR /&gt;&lt;BR /&gt;#Test second parameter&lt;BR /&gt;case $PKG in&lt;BR /&gt; SECU|secu        ) CONF=$PARMDIR/secu.conf ;;&lt;BR /&gt; SECU_QA|secu_qa  ) CONF=$PARMDIR/secu_qa.conf ;;&lt;BR /&gt; SECU_TST|secu_tst) CONF=$PARMDIR/secu_tst.conf ;;&lt;BR /&gt;"transfer_secu_DEV.sh" 68 lines, 2498 characters&lt;BR /&gt;&lt;BR /&gt;[root@bdhp4337:/var/opt/secu/scripts]&lt;BR /&gt;# ./transfer_secu_DEV.sh&lt;BR /&gt;251005 bdsn4013 COMPLETED&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 04:13:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656759#M241295</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2005-10-25T04:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656760#M241296</link>
      <description>I saw the remsh statement.&lt;BR /&gt;if [ `remsh $CLN uname -s 2&amp;gt; /dev/null|grep -e SunOS -e | -e HP-UX |wc -l` -lt 1 ]then echo "$DATE $CLN FAILED Either hostname is incorrect or remsh is not working from bdhp4337." |tee -a $LOG;continue;fi&lt;BR /&gt;&lt;BR /&gt;Why not simplify it??&lt;BR /&gt;&lt;BR /&gt;count=$(remsh $CLN 'uname -s 2&amp;gt;/dev/null'|egrep 'SunOS|AIX|HP-UX|wc -l)&lt;BR /&gt;if [[ ${count} -lt 1 ]];then&lt;BR /&gt;your_code here&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Oct 2005 04:20:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656760#M241296</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-25T04:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656761#M241297</link>
      <description>Hi Rac, &lt;BR /&gt;&lt;BR /&gt;Thanks. I have modified it. It still gave me the same problem. &lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 25 Oct 2005 04:35:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656761#M241297</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2005-10-25T04:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656762#M241298</link>
      <description>set -vx and run the script. check the output carefully and you should be able to point out.</description>
      <pubDate>Tue, 25 Oct 2005 04:47:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656762#M241298</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-10-25T04:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656763#M241299</link>
      <description>Dewa,&lt;BR /&gt;&lt;BR /&gt;Run your script at the command line with debugging on.&lt;BR /&gt;&lt;BR /&gt;# sh -x &amp;lt;script_name&amp;gt;&lt;BR /&gt;&lt;BR /&gt;What's meant by "When I tried to run it, it only run for first line (bdsn4013 SECU). It can not go to the second line,etc." Please clarify?&lt;BR /&gt;&lt;BR /&gt;regards!</description>
      <pubDate>Tue, 25 Oct 2005 08:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656763#M241299</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-10-25T08:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656764#M241300</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I think the remsh-line is your problem:&lt;BR /&gt;if [ `remsh $CLN uname -s ...&lt;BR /&gt;&lt;BR /&gt;remsh will read from stdin normally - change to 'remsh -n' so remsh will no try to read from stdin and so the second line will not be 'eaten'.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 26 Oct 2005 02:03:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656764#M241300</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2005-10-26T02:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting issue : Can not read the second line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656765#M241301</link>
      <description>So, what does this line do?&lt;BR /&gt;&lt;BR /&gt;bdsn4013 SECU&lt;BR /&gt;&lt;BR /&gt;Does it finish?&lt;BR /&gt;&lt;BR /&gt;Turn on script and run it with set -x&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Oct 2005 09:09:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-issue-can-not-read-the-second-line/m-p/3656765#M241301</guid>
      <dc:creator>Al Langen_1</dc:creator>
      <dc:date>2005-10-26T09:09:33Z</dc:date>
    </item>
  </channel>
</rss>

