<?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 guru help needed for script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714392#M61391</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I wrote a script for backup, what the script is doing right now is if any arguments is missing It will exit, but since another program calling this script I don't want the to exit at any stage, rather i'll wait and the input. If the tape is not there it give a message and wait till the some put the tape in the drive and script is keep running in a loop. Can anyone put light here</description>
    <pubDate>Tue, 30 Apr 2002 17:26:52 GMT</pubDate>
    <dc:creator>Anthony khan</dc:creator>
    <dc:date>2002-04-30T17:26:52Z</dc:date>
    <item>
      <title>guru help needed for script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714392#M61391</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I wrote a script for backup, what the script is doing right now is if any arguments is missing It will exit, but since another program calling this script I don't want the to exit at any stage, rather i'll wait and the input. If the tape is not there it give a message and wait till the some put the tape in the drive and script is keep running in a loop. Can anyone put light here</description>
      <pubDate>Tue, 30 Apr 2002 17:26:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714392#M61391</guid>
      <dc:creator>Anthony khan</dc:creator>
      <dc:date>2002-04-30T17:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: guru help needed for script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714393#M61392</link>
      <description>Anthony,&lt;BR /&gt;&lt;BR /&gt;take this code:&lt;BR /&gt;&lt;BR /&gt;# Checking if device is given&lt;BR /&gt;&lt;BR /&gt;if [ -z "$DEVICE" ]&lt;BR /&gt;then&lt;BR /&gt;        echo $MESSAGE1&lt;BR /&gt;        echo $MESSAGE2&lt;BR /&gt; exit 1&lt;BR /&gt; else&lt;BR /&gt;       mt -t "$DEVICE" rew&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;    echo "There is no tape"&lt;BR /&gt;else&lt;BR /&gt;    echo " Tape is loaded."&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and replace it with this:&lt;BR /&gt;##############################&lt;BR /&gt;# Checking if device is given&lt;BR /&gt;&lt;BR /&gt;if [ -z "$DEVICE" ]&lt;BR /&gt;then&lt;BR /&gt;        echo $MESSAGE1&lt;BR /&gt;        echo $MESSAGE2&lt;BR /&gt; exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;mt -t "$DEVICE" rew&lt;BR /&gt;TAPEISLOADED=$?&lt;BR /&gt;&lt;BR /&gt;while [ "$TAPEISLOADED" != "0" ]&lt;BR /&gt;do&lt;BR /&gt;    echo "There is no tape"&lt;BR /&gt;# send an email here to notify someone&lt;BR /&gt;sleep 60&lt;BR /&gt;mt -t "$DEVICE" rew&lt;BR /&gt;TAPEISLOADED=$?&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;    echo " Tape is loaded."&lt;BR /&gt;&lt;BR /&gt;##############################&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Apr 2002 19:15:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714393#M61392</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-30T19:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: guru help needed for script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714394#M61393</link>
      <description>Hi Anthony.  Maybe this will work.  As you check to see wether or not each required element is present or not run each required element through a loop check.  I will try to give an example:&lt;BR /&gt;# Checking to see if device is given&lt;BR /&gt;if [ -z "$DEVICE" ]&lt;BR /&gt;then&lt;BR /&gt;    echo "Please enter valid device name."&lt;BR /&gt;    echo "Press Enter when done."&lt;BR /&gt;    read answer1&lt;BR /&gt;else&lt;BR /&gt;mt -t "$DEVICE" rew&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Something like this, if the parameter is not entered, prompt the user and the script will wait for their reply before continuing.</description>
      <pubDate>Tue, 30 Apr 2002 19:39:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714394#M61393</guid>
      <dc:creator>Jeffrey Davis_1</dc:creator>
      <dc:date>2002-04-30T19:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: guru help needed for script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714395#M61394</link>
      <description>hi try this,&lt;BR /&gt;&lt;BR /&gt;if [ -z "$DEVICE" ]&lt;BR /&gt;then&lt;BR /&gt;        echo "Check Device name/insert the  tape and press any key when ready"&lt;BR /&gt;        read accept&lt;BR /&gt;else&lt;BR /&gt;       mt -t "$DEVICE" rew&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regds&lt;BR /&gt;ravi</description>
      <pubDate>Wed, 01 May 2002 09:50:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/guru-help-needed-for-script/m-p/2714395#M61394</guid>
      <dc:creator>V. V. Ravi Kumar_1</dc:creator>
      <dc:date>2002-05-01T09:50:17Z</dc:date>
    </item>
  </channel>
</rss>

