<?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 Why doesn't top command  work in my script? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126984#M93140</link>
    <description>Hi All&lt;BR /&gt;I have a script as bellow&lt;BR /&gt;--&lt;BR /&gt;GetDate=`date +"%Y%m%d"`&lt;BR /&gt;LOG_NM=/home/hoanglh/report$GetDate&lt;BR /&gt;who -q|grep users&amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;sar -d 5 5 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;/usr/bin/top -h -d 1 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;Exit&lt;BR /&gt;---&lt;BR /&gt;All command above /usr/bin/top ran OK.&lt;BR /&gt;except /usr/bin/top command did not work?? i do not know why??? Just suspect of exit command&lt;BR /&gt;Have you ever experience with??</description>
    <pubDate>Thu, 10 Jan 2008 05:01:08 GMT</pubDate>
    <dc:creator>Nguyen Anh Tien</dc:creator>
    <dc:date>2008-01-10T05:01:08Z</dc:date>
    <item>
      <title>Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126984#M93140</link>
      <description>Hi All&lt;BR /&gt;I have a script as bellow&lt;BR /&gt;--&lt;BR /&gt;GetDate=`date +"%Y%m%d"`&lt;BR /&gt;LOG_NM=/home/hoanglh/report$GetDate&lt;BR /&gt;who -q|grep users&amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;sar -d 5 5 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;/usr/bin/top -h -d 1 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;Exit&lt;BR /&gt;---&lt;BR /&gt;All command above /usr/bin/top ran OK.&lt;BR /&gt;except /usr/bin/top command did not work?? i do not know why??? Just suspect of exit command&lt;BR /&gt;Have you ever experience with??</description>
      <pubDate>Thu, 10 Jan 2008 05:01:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126984#M93140</guid>
      <dc:creator>Nguyen Anh Tien</dc:creator>
      <dc:date>2008-01-10T05:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126985#M93141</link>
      <description>use like this&lt;BR /&gt;&lt;BR /&gt;export UNIX95=1;/usr/bin/top -h -n5 -d1 -f &amp;gt;&amp;gt;$LOG_NM</description>
      <pubDate>Thu, 10 Jan 2008 05:20:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126985#M93141</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2008-01-10T05:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126986#M93142</link>
      <description>&lt;P&gt;&amp;gt;ahsan: export UNIX95=1;/usr/bin/top -h -n5 -d1 -f &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;&lt;BR /&gt;Why would you use UNIX95? That's for ps(1).&lt;BR /&gt;Also, you don't want to export it:&lt;BR /&gt;$ UNIX95=EXTENDED_PS ps -Hfu $LOGNAME&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2011 23:36:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126986#M93142</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-17T23:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126987#M93143</link>
      <description>its a old unix command like statement&lt;BR /&gt;&lt;BR /&gt;anyway nguyen you can just ignore the export .</description>
      <pubDate>Thu, 10 Jan 2008 05:49:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126987#M93143</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2008-01-10T05:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126988#M93144</link>
      <description>Sorry, for further deviating from the thread's topic.&lt;BR /&gt;But apart from the useless use of UNIX95 in top context,&lt;BR /&gt;setting it as suggested (i.e. along with the false trailing semicolon) is utterly wrong, insofar as a set environment variable will change the behavior of all XPG4 aware commands for the pending shell with possibly escaping the notice of the shell's user.&lt;BR /&gt;So the recommended usage of this environment variable is in fact as Dennis has demonstrated so that it only effects the command immediately issued.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 09:17:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126988#M93144</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2008-01-10T09:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126989#M93145</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To add to your answer.  Using 'top' without the '-f filename' switch and argument (as you did) tells 'top' to add terminal-formatting codes to its output stream.  This renders the redirected output in your logfile rather useless.&lt;BR /&gt;&lt;BR /&gt;You want:&lt;BR /&gt;&lt;BR /&gt;# top -h -d 1 -f ${LOG_NM}&lt;BR /&gt;&lt;BR /&gt;Notice that NO redirection is used.  'top' will append to the file used as the argument of '-f'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 13:12:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126989#M93145</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-10T13:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126990#M93146</link>
      <description>Thank you all.&lt;BR /&gt;I do not want to export UNIX95 because it effects to my environment.&lt;BR /&gt;I changed my script as&lt;BR /&gt;UNIX95=1;/usr/bin/top -h -d 1 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;but it still did not works.&lt;BR /&gt;Hi ahsan, Ralph do you have any ideas???&lt;BR /&gt;I will changes my script as&lt;BR /&gt;/usr/bin/top -h -d -f $LOG_NM&lt;BR /&gt;I will rely the result soon&lt;BR /&gt;thank for your help&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Jan 2008 09:49:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126990#M93146</guid>
      <dc:creator>Nguyen Anh Tien</dc:creator>
      <dc:date>2008-01-11T09:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126991#M93147</link>
      <description>&amp;gt; UNIX95=1;/usr/bin/top -h -d 1 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;&amp;gt; but it still did not works.&lt;BR /&gt; &lt;BR /&gt;Remove UNIX95 completely from your script. It has no meaning here.&lt;BR /&gt; &lt;BR /&gt;&amp;gt; I will changes my script as&lt;BR /&gt;&amp;gt; /usr/bin/top -h -d -f $LOG_NM&lt;BR /&gt; &lt;BR /&gt;This will work just fine. top was not originally designed as a script program but instead manipulates your terminal window. So the -f option in top turns off this special handling.</description>
      <pubDate>Fri, 11 Jan 2008 12:09:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126991#M93147</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-01-11T12:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126992#M93148</link>
      <description>Hi (again) Nquyen:&lt;BR /&gt;&lt;BR /&gt;Read again my post, above.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I will changes my script as&lt;BR /&gt;/usr/bin/top -h -d -f $LOG_NM&lt;BR /&gt;&lt;BR /&gt;That will not work, you need:&lt;BR /&gt;&lt;BR /&gt;I will changes my script as&lt;BR /&gt;/usr/bin/top -h -d1 -f $LOG_NM&lt;BR /&gt;&lt;BR /&gt;...or a least a non-zero argument following the '-d' switch.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Jan 2008 12:37:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126992#M93148</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-11T12:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126993#M93149</link>
      <description>Hi all&lt;BR /&gt;I change my script as:&lt;BR /&gt;===&lt;BR /&gt;GetDate=`date +"%Y%m%d"`&lt;BR /&gt;LOG_NM=/home/hoanglh/report$GetDate&lt;BR /&gt;who -q|grep users&amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;sar -d 5 5 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;/usr/bin/top -h â  d1 -f $LOG_NM&lt;BR /&gt;==&lt;BR /&gt;But top command doesn't works.&lt;BR /&gt;Please help me to point out why&lt;BR /&gt;Point has been assigned to acknowledge your support&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Jan 2008 08:23:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126993#M93149</guid>
      <dc:creator>Nguyen Anh Tien</dc:creator>
      <dc:date>2008-01-18T08:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126994#M93150</link>
      <description>Hi&lt;BR /&gt;How do you start that script?&lt;BR /&gt;cron? startup? command line?&lt;BR /&gt;Is there any error message?&lt;BR /&gt;just try TERM=xterm  /usr/bin/top -h -d 1 &amp;gt;&amp;gt;$LOG_NM</description>
      <pubDate>Fri, 18 Jan 2008 09:13:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126994#M93150</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2008-01-18T09:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't top command  work in my script?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126995#M93151</link>
      <description>Hi (again) Nguyen:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;  change my script as:&lt;BR /&gt;===&lt;BR /&gt;GetDate=`date +"%Y%m%d"`&lt;BR /&gt;LOG_NM=/home/hoanglh/report$GetDate&lt;BR /&gt;who -q|grep users&amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;sar -d 5 5 &amp;gt;&amp;gt;$LOG_NM&lt;BR /&gt;/usr/bin/top -h bd1 -f $LOG_NM&lt;BR /&gt;==&lt;BR /&gt;&lt;BR /&gt;&amp;gt; But top command doesn't works.&lt;BR /&gt;&lt;BR /&gt;Your switches and arguments to 'top' are wrong.  &lt;BR /&gt;&lt;BR /&gt;You have:&lt;BR /&gt;&lt;BR /&gt;/usr/bin/top -h bd1 -f $LOG_NM&lt;BR /&gt;&lt;BR /&gt;...which needs to be:&lt;BR /&gt;&lt;BR /&gt;/usr/bin/top -h -d1 -f $LOG_NM&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 18 Jan 2008 12:38:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-doesn-t-top-command-work-in-my-script/m-p/4126995#M93151</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-18T12:38:19Z</dc:date>
    </item>
  </channel>
</rss>

