<?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: scripts and case statement in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857410#M703858</link>
    <description>It seems like you're looking for the command to make the script exit?  It's "exit", as in:&lt;BR /&gt;&lt;BR /&gt;"99" )&lt;BR /&gt;      echo exiting...&lt;BR /&gt;      exit 0;;</description>
    <pubDate>Fri, 06 Aug 2004 08:47:33 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2004-08-06T08:47:33Z</dc:date>
    <item>
      <title>scripts and case statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857409#M703857</link>
      <description>I am trying to write a script to make the job of copying files a much easier task. Here is my attempt at the script. I would like the script to repeat, and stop when a command like "99" is entered. &lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# An example with the case statement&lt;BR /&gt;# Reads a command from the user and processes it&lt;BR /&gt;echo "Enter your command (e.g. 724778:801)"&lt;BR /&gt;read command&lt;BR /&gt;case "$command" in&lt;BR /&gt; 724778-801)&lt;BR /&gt;  cp /hp3070/qm/pbq/$command/events A04940.txt&lt;BR /&gt; ;;&lt;BR /&gt; 724778:803)&lt;BR /&gt;  cp /hp3070/qm/pbq/$command/events A04278.txt&lt;BR /&gt; ;;&lt;BR /&gt; 724782-801)&lt;BR /&gt; cp /hp3070/qm/pbq/$command/events A04615.txt&lt;BR /&gt; ;;&lt;BR /&gt; 99)&lt;BR /&gt; echo "exit"&lt;BR /&gt; ?? (command to exit &lt;BR /&gt; ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Aug 2004 08:43:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857409#M703857</guid>
      <dc:creator>Jeffrey W. Stewart</dc:creator>
      <dc:date>2004-08-06T08:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: scripts and case statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857410#M703858</link>
      <description>It seems like you're looking for the command to make the script exit?  It's "exit", as in:&lt;BR /&gt;&lt;BR /&gt;"99" )&lt;BR /&gt;      echo exiting...&lt;BR /&gt;      exit 0;;</description>
      <pubDate>Fri, 06 Aug 2004 08:47:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857410#M703858</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-08-06T08:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: scripts and case statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857411#M703859</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;command=ok&lt;BR /&gt;while [ "$command" != "99" ]&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;your script&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The do loop will repeat as long as command is not 99&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;               Steve Steel</description>
      <pubDate>Fri, 06 Aug 2004 08:54:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857411#M703859</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2004-08-06T08:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: scripts and case statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857412#M703860</link>
      <description>Use exit &lt;RETURN-CODE&gt; for that. By normal successful exit use exit 0 at the end of every shell script. To differentiate use exit 1 or some int. It will be good as like system commands.&lt;BR /&gt;&lt;BR /&gt; And more if you are giving an unknown option then your script will not handle that one.&lt;BR /&gt;&lt;BR /&gt; So use as like &lt;BR /&gt;&lt;BR /&gt; *)&lt;BR /&gt;   echo "Unknown options.. and your set of options"&lt;BR /&gt;   exit 2&lt;BR /&gt;&lt;BR /&gt;  It will be very good on your script.&lt;BR /&gt;&lt;BR /&gt;Muthukumar.&lt;BR /&gt;&lt;BR /&gt;&lt;/RETURN-CODE&gt;</description>
      <pubDate>Fri, 06 Aug 2004 10:30:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857412#M703860</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-08-06T10:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: scripts and case statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857413#M703861</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The following usually works fine:&lt;BR /&gt;&lt;BR /&gt;while true; do&lt;BR /&gt;echo "Enter your command (e.g. 724778:801)"&lt;BR /&gt;read command&lt;BR /&gt;case $command in&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;99) break ;;&lt;BR /&gt;*) echo "Input error:&amp;lt;$command&amp;gt;" ;;&lt;BR /&gt;esac&lt;BR /&gt;done</description>
      <pubDate>Fri, 06 Aug 2004 12:15:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857413#M703861</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2004-08-06T12:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: scripts and case statement</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857414#M703862</link>
      <description>Solution was provided and I am closing threads that have been open and have answers</description>
      <pubDate>Wed, 05 Jan 2005 10:06:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-and-case-statement/m-p/4857414#M703862</guid>
      <dc:creator>Jeffrey W. Stewart</dc:creator>
      <dc:date>2005-01-05T10:06:07Z</dc:date>
    </item>
  </channel>
</rss>

