<?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 unix commands in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864829#M277328</link>
    <description>You can check the exit code for the command with:&lt;BR /&gt;&lt;BR /&gt;echo $?&lt;BR /&gt;&lt;BR /&gt;So, you can do somethig like:&lt;BR /&gt;&lt;BR /&gt;RESULT=`command1; echo $?`&lt;BR /&gt;&lt;BR /&gt;if [ $RESULT -eq 0 ]; then&lt;BR /&gt;  echo "command executed correctly"&lt;BR /&gt;else&lt;BR /&gt;  echo "Last command executed with errors"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;RESULT=`command2; echo $?`&lt;BR /&gt;&lt;BR /&gt;if [ $RESULT -eq 0 ]; then&lt;BR /&gt;  echo "command executed correctly"&lt;BR /&gt;else&lt;BR /&gt;  echo "Last command executed with errors"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;RESULT=`commandN; echo $?`&lt;BR /&gt;&lt;BR /&gt;if [ $RESULT -eq 0 ]; then&lt;BR /&gt;  echo "command executed correctly"&lt;BR /&gt;else&lt;BR /&gt;  echo "Last command executed with errors"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi</description>
    <pubDate>Mon, 18 Sep 2006 15:39:13 GMT</pubDate>
    <dc:creator>Ivan Ferreira</dc:creator>
    <dc:date>2006-09-18T15:39:13Z</dc:date>
    <item>
      <title>Scripting unix commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864827#M277326</link>
      <description>I am wanting to create a script that will save me some time and help prevent keystroke errors during recovery periods.  I am wanting to execute several unix commands in a designated order but need to incoporate checks so that I know that a command completed successfully prior to moving onto the next command.  The commands I am looking at are vgimport, vgchange, mount, vgcfgbackup.  I am struggling with best approach...suggestions are appreciated.</description>
      <pubDate>Mon, 18 Sep 2006 14:19:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864827#M277326</guid>
      <dc:creator>Rose Marie Mansell</dc:creator>
      <dc:date>2006-09-18T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting unix commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864828#M277327</link>
      <description>If you better explain what exactly you want to automate then it would be easier to write script.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Sep 2006 14:25:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864828#M277327</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-18T14:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting unix commands</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864829#M277328</link>
      <description>You can check the exit code for the command with:&lt;BR /&gt;&lt;BR /&gt;echo $?&lt;BR /&gt;&lt;BR /&gt;So, you can do somethig like:&lt;BR /&gt;&lt;BR /&gt;RESULT=`command1; echo $?`&lt;BR /&gt;&lt;BR /&gt;if [ $RESULT -eq 0 ]; then&lt;BR /&gt;  echo "command executed correctly"&lt;BR /&gt;else&lt;BR /&gt;  echo "Last command executed with errors"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;RESULT=`command2; echo $?`&lt;BR /&gt;&lt;BR /&gt;if [ $RESULT -eq 0 ]; then&lt;BR /&gt;  echo "command executed correctly"&lt;BR /&gt;else&lt;BR /&gt;  echo "Last command executed with errors"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;RESULT=`commandN; echo $?`&lt;BR /&gt;&lt;BR /&gt;if [ $RESULT -eq 0 ]; then&lt;BR /&gt;  echo "command executed correctly"&lt;BR /&gt;else&lt;BR /&gt;  echo "Last command executed with errors"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi</description>
      <pubDate>Mon, 18 Sep 2006 15:39:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-unix-commands/m-p/3864829#M277328</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-09-18T15:39:13Z</dc:date>
    </item>
  </channel>
</rss>

