<?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 script help req. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648394#M677265</link>
    <description>My dynamic log contents only below three entries:&lt;BR /&gt;red&lt;BR /&gt;blue&lt;BR /&gt;green&lt;BR /&gt;&lt;BR /&gt;I am looking for a script which looks contents of log and incase any entry is missing it will put into another log.&lt;BR /&gt;&lt;BR /&gt;FILE=`cat cl`&lt;BR /&gt;for i in `$FILE`&lt;BR /&gt;do&lt;BR /&gt;if [ "$i" = "red" ] || [ "$i" = "blue" ] || [ "$i" = "green" ]&lt;BR /&gt;then&lt;BR /&gt;echo ""&lt;BR /&gt;else&lt;BR /&gt;echo $i &amp;gt; moni.log&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This SCript is not working.. Pls help</description>
    <pubDate>Wed, 16 Jun 2010 10:15:54 GMT</pubDate>
    <dc:creator>Archana1</dc:creator>
    <dc:date>2010-06-16T10:15:54Z</dc:date>
    <item>
      <title>script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648394#M677265</link>
      <description>My dynamic log contents only below three entries:&lt;BR /&gt;red&lt;BR /&gt;blue&lt;BR /&gt;green&lt;BR /&gt;&lt;BR /&gt;I am looking for a script which looks contents of log and incase any entry is missing it will put into another log.&lt;BR /&gt;&lt;BR /&gt;FILE=`cat cl`&lt;BR /&gt;for i in `$FILE`&lt;BR /&gt;do&lt;BR /&gt;if [ "$i" = "red" ] || [ "$i" = "blue" ] || [ "$i" = "green" ]&lt;BR /&gt;then&lt;BR /&gt;echo ""&lt;BR /&gt;else&lt;BR /&gt;echo $i &amp;gt; moni.log&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This SCript is not working.. Pls help</description>
      <pubDate>Wed, 16 Jun 2010 10:15:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648394#M677265</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-06-16T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648395#M677266</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1435125" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1435125&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;rgs,</description>
      <pubDate>Wed, 16 Jun 2010 10:59:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648395#M677266</guid>
      <dc:creator>rariasn</dc:creator>
      <dc:date>2010-06-16T10:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648396#M677267</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Your script is running infinitely.&lt;BR /&gt;&lt;BR /&gt;Instead of:&lt;BR /&gt;&lt;BR /&gt;# for i in `$FILE`&lt;BR /&gt;&lt;BR /&gt;...you want:&lt;BR /&gt;&lt;BR /&gt;# for i in "$FILE"&lt;BR /&gt;&lt;BR /&gt;That is, you don't want back-ticks to cause the shell to execute.&lt;BR /&gt;&lt;BR /&gt;The use of back-ticks is discouraged in POSIX compliant shells.  The preferred notation for:&lt;BR /&gt;&lt;BR /&gt;# FILE=`cat cl`&lt;BR /&gt;&lt;BR /&gt;...would be:&lt;BR /&gt;&lt;BR /&gt;# FILE=$(cat cl)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 16 Jun 2010 11:36:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648396#M677267</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-06-16T11:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648397#M677268</link>
      <description>James thanks for response.&lt;BR /&gt;&lt;BR /&gt;I wrote an script - which checks for process status. In case process  not running should  puts other log file stating process is down.&lt;BR /&gt;&lt;BR /&gt;ARTIS=`ps -xef | grep java | grep ArtePryServer | awk '{print $(NF-2)}' | cut -c 54-74` &lt;BR /&gt;VAR=`ps -ef | grep 4445 | grep -v grep |awk '{print $NF}'`&lt;BR /&gt;&lt;BR /&gt;if [ "$ARTIS" = ???? ]&lt;BR /&gt;then&lt;BR /&gt;echo "ARTIS down"&lt;BR /&gt;else&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;if [ "VAR" = ??? ]&lt;BR /&gt;then&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Iam stuck with statement ... Pls help me..&lt;BR /&gt;Just incase required the real variable values  are :-&lt;BR /&gt; &lt;BR /&gt;ARTIS=ArtemisServer&lt;BR /&gt;VAR=4445</description>
      <pubDate>Thu, 17 Jun 2010 01:24:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648397#M677268</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-06-17T01:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648398#M677269</link>
      <description>&amp;gt;if [ "$ARTIS" = ??? ]; then&lt;BR /&gt;&amp;gt;if [ "$VAR" = ??? ]; then&lt;BR /&gt;&lt;BR /&gt;What should $ARTIS and $VAR be?&lt;BR /&gt;If you want to check for empty you could use the obvious:&lt;BR /&gt;if [ "$ARTIS" = "" ]; then&lt;BR /&gt;&lt;BR /&gt;Or:&lt;BR /&gt;if [ -z "$ARTIS" ]; then</description>
      <pubDate>Thu, 17 Jun 2010 11:23:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648398#M677269</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-06-17T11:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648399#M677270</link>
      <description>Simplest solution:&lt;BR /&gt;&lt;BR /&gt;if [ -z "$ARTIS" ]&lt;BR /&gt;then&lt;BR /&gt;echo "Artis is down"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;(There came no matching output from the ps command.)</description>
      <pubDate>Fri, 18 Jun 2010 10:28:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648399#M677270</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2010-06-18T10:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648400#M677271</link>
      <description>I have created script as below. Some times shell give 'return 1'  Error, Although process up and running fine.&lt;BR /&gt;Any possibility to avoid this 'return 1' error.&lt;BR /&gt;&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;export PIDWEB=`ps -ef |grep 4444|grep start |grep -v grep|awk '{print $NF}'`&lt;BR /&gt;if [ -z "$PIDWEB" ]&lt;BR /&gt;then&lt;BR /&gt;echo "down" &amp;gt; /var/opt/admin/javanode.log&lt;BR /&gt;else&lt;BR /&gt;echo "up" &amp;gt; /tmp/javanode.log&lt;BR /&gt;echo "" &amp;gt; /var/opt/admin/javanode.log&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jul 2010 13:24:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648400#M677271</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-07-08T13:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648401#M677272</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I have created script as below. Some times shell give 'return 1' Error, Although process up and running fine.&lt;BR /&gt;&lt;BR /&gt;You aren't testing the return code of anything in the script you have shown.&lt;BR /&gt;&lt;BR /&gt;Be aware that 'grep'ing for a process needs to be very explicit.  You can find or miss matches with ease.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 08 Jul 2010 13:32:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648401#M677272</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-08T13:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648402#M677273</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;I would add, that instead of doing:&lt;BR /&gt;&lt;BR /&gt;# export PIDWEB=`ps -ef |grep 4444|grep start |grep -v grep|awk '{print $NF}'`&lt;BR /&gt;&lt;BR /&gt;...and you know the name of the process in question, do something like this:&lt;BR /&gt;&lt;BR /&gt;# PIDWEB=$(UNIX95= ps -C syslogd -opid= -oargs=)&lt;BR /&gt;&lt;BR /&gt;This example assumes that the process you want to verify is the 'syslogd' daemon.  If it's running, the 'PIDWEB' variable would contain something like:&lt;BR /&gt;&lt;BR /&gt;756 /usr/sbin/syslogd -N -D -v&lt;BR /&gt;&lt;BR /&gt;You can examine the manpages for 'ps' to see the various pieces of data that you can collect.  Here, I chose to capture the pid and the arguments used to start 'syslogd'.&lt;BR /&gt;&lt;BR /&gt;Using the XPG4 (UNIX95) behavior for 'ps' allows you to specifically select a process by name ('-C') and to explicitly choose the data you want returned.  Do *not* set 'UNIX95' for other than the duration of the command line.  That's what the 'UNIX95= ps ...' notation does.  There is no semicolon following the "=", only whitespace.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 08 Jul 2010 13:45:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648402#M677273</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-08T13:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648403#M677274</link>
      <description>This return code is creating one alert for OPS team. &lt;BR /&gt;Is there any way I can suppress/avoid this return value within the script..&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jul 2010 13:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648403#M677274</guid>
      <dc:creator>Archana1</dc:creator>
      <dc:date>2010-07-08T13:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: script help req.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648404#M677275</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; This return code is creating one alert for OPS team. Is there any way I can suppress/avoid this return value within the script..&lt;BR /&gt;&lt;BR /&gt;Other than the return code of the last command executed, your script isn't returning anything other than the success or failure of the last command executed.  I don't think you are showing everything!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 08 Jul 2010 13:57:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-req/m-p/4648404#M677275</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-08T13:57:13Z</dc:date>
    </item>
  </channel>
</rss>

