<?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 urgent in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545493#M866331</link>
    <description>Hi, try this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;SYSTEM=`hostname`&lt;BR /&gt;STALE=`vgdisplay -v | grep stale | wc -l`&lt;BR /&gt;&lt;BR /&gt;print "$SYSTEM"&lt;BR /&gt;&lt;BR /&gt;print `date`&lt;BR /&gt;&lt;BR /&gt;if [ $STALE = 0 ];then&lt;BR /&gt;   echo "No Stale Mirrors on $SYSTEM"&lt;BR /&gt;else&lt;BR /&gt;   echo "The Following Mirrors are Stale on $SYSTEM: "&lt;BR /&gt;   vgdisplay -v | egrep -e "LV Name" -e "stale"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;UNAVAIL=`vgdisplay -v | grep unavail | wc -l`&lt;BR /&gt;&lt;BR /&gt;if [ $UNAVAIL = 0 ];then&lt;BR /&gt;   echo "No Unavailable Drives on $SYSTEM"&lt;BR /&gt;else&lt;BR /&gt;   echo "The Following Drives are Unavailable on $SYSTEM: "&lt;BR /&gt;   vgdisplay -v | egrep -e "Name" -e "unavail" &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Uptime Output"&lt;BR /&gt;uptime&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Who -br Output"&lt;BR /&gt;who -br&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Output of bdf -l"&lt;BR /&gt;bdf -l&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Last 10 Lines of Dmesg"&lt;BR /&gt;echo ""&lt;BR /&gt;dmesg | tail -10&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Last 25 Lines of /var/adm/syslog/syslog.log"&lt;BR /&gt;echo ""&lt;BR /&gt;tail -25 /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Ioscan Output"&lt;BR /&gt;ioscan -kf&lt;BR /&gt;&lt;BR /&gt;When you run it you can pipe it to a file or e-mail it to yourself etc.  I  hope this helps.&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 27 Jun 2001 01:36:01 GMT</pubDate>
    <dc:creator>Rob Smith</dc:creator>
    <dc:date>2001-06-27T01:36:01Z</dc:date>
    <item>
      <title>script help urgent</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545491#M866329</link>
      <description>i want to write a script to output multiple commands output to a file eg . list dmesg,ioscan &amp;amp; bdf output to a.out file.</description>
      <pubDate>Wed, 27 Jun 2001 01:10:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545491#M866329</guid>
      <dc:creator>CHEN WAI CHUAN</dc:creator>
      <dc:date>2001-06-27T01:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: script help urgent</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545492#M866330</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;To get the output of multiple commands into one output file, you just need to specify the redirection to append to the file.  Try something like this:&lt;BR /&gt;&lt;BR /&gt;dmesg &amp;gt;file.txt&lt;BR /&gt;ioscan -fn &amp;gt;&amp;gt;file.txt&lt;BR /&gt;bdf &amp;gt;&amp;gt;file.txt&lt;BR /&gt;&lt;BR /&gt;The first redirection just uses one greater than symbol '&amp;gt;' which will create the file and send standard output to it.  The next two redirections use two greater than symbols '&amp;gt;&amp;gt;' which append to the file.  If you want to keep writing information to the same file without clearing it at the start you can make the first command use '&amp;gt;&amp;gt;' also.&lt;BR /&gt;&lt;BR /&gt;I hope this helps you.  If not, post another question and we'll try something else.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jun 2001 01:34:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545492#M866330</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2001-06-27T01:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: script help urgent</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545493#M866331</link>
      <description>Hi, try this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;SYSTEM=`hostname`&lt;BR /&gt;STALE=`vgdisplay -v | grep stale | wc -l`&lt;BR /&gt;&lt;BR /&gt;print "$SYSTEM"&lt;BR /&gt;&lt;BR /&gt;print `date`&lt;BR /&gt;&lt;BR /&gt;if [ $STALE = 0 ];then&lt;BR /&gt;   echo "No Stale Mirrors on $SYSTEM"&lt;BR /&gt;else&lt;BR /&gt;   echo "The Following Mirrors are Stale on $SYSTEM: "&lt;BR /&gt;   vgdisplay -v | egrep -e "LV Name" -e "stale"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;UNAVAIL=`vgdisplay -v | grep unavail | wc -l`&lt;BR /&gt;&lt;BR /&gt;if [ $UNAVAIL = 0 ];then&lt;BR /&gt;   echo "No Unavailable Drives on $SYSTEM"&lt;BR /&gt;else&lt;BR /&gt;   echo "The Following Drives are Unavailable on $SYSTEM: "&lt;BR /&gt;   vgdisplay -v | egrep -e "Name" -e "unavail" &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Uptime Output"&lt;BR /&gt;uptime&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Who -br Output"&lt;BR /&gt;who -br&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Output of bdf -l"&lt;BR /&gt;bdf -l&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Last 10 Lines of Dmesg"&lt;BR /&gt;echo ""&lt;BR /&gt;dmesg | tail -10&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Last 25 Lines of /var/adm/syslog/syslog.log"&lt;BR /&gt;echo ""&lt;BR /&gt;tail -25 /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Ioscan Output"&lt;BR /&gt;ioscan -kf&lt;BR /&gt;&lt;BR /&gt;When you run it you can pipe it to a file or e-mail it to yourself etc.  I  hope this helps.&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jun 2001 01:36:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545493#M866331</guid>
      <dc:creator>Rob Smith</dc:creator>
      <dc:date>2001-06-27T01:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: script help urgent</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545494#M866332</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you wish to run something simple you&lt;BR /&gt;just use the script program:&lt;BR /&gt;&lt;BR /&gt;# script /tmp/output&lt;BR /&gt;# dmesg&lt;BR /&gt;# ioscan -fn&lt;BR /&gt;# bdf&lt;BR /&gt;# vgdisplay -v&lt;BR /&gt;&lt;BR /&gt;etc etc...&lt;BR /&gt;The output of all of these will go to &lt;BR /&gt;/tmp/output&lt;BR /&gt;&lt;BR /&gt;To finish use Cntl D&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Michael</description>
      <pubDate>Wed, 27 Jun 2001 01:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545494#M866332</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2001-06-27T01:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: script help urgent</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545495#M866333</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can redirect all output within a script when adding a line such as:&lt;BR /&gt;&lt;BR /&gt;exec &amp;gt;file.log&lt;BR /&gt;&lt;BR /&gt;at the top of the script. All following command will put their output to the file.log&lt;BR /&gt;&lt;BR /&gt;Using&lt;BR /&gt;&lt;BR /&gt;exec &amp;gt;file.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;will also redirect standard error of all following commands to the file.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 27 Jun 2001 06:28:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-urgent/m-p/2545495#M866333</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-06-27T06:28:35Z</dc:date>
    </item>
  </channel>
</rss>

