<?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: Menu scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547084#M875199</link>
    <description>Another choice is the select statement in POSIX and ksh shells. It is a select..do..done type of statement as in:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PS3="/nChoose number:"&lt;BR /&gt;select ANS in new prev next edit exit quit&lt;BR /&gt;do &lt;BR /&gt;case $ANS in&lt;BR /&gt;new) print "New choice";;&lt;BR /&gt;prev) print "Go back";;&lt;BR /&gt;prev|next) print "edit things";;&lt;BR /&gt;exit|quit) break;;&lt;BR /&gt;*) print "Bad choice";;&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;PS3 is the select prompt. Multiple columns are automatically formatted to fit within LINES and COLUMNS.  select is repeated until the script hits a break, exit or return.  TMOUT can be changed to perform a timeout.</description>
    <pubDate>Fri, 29 Jun 2001 21:33:49 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2001-06-29T21:33:49Z</dc:date>
    <item>
      <title>Menu scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547080#M875195</link>
      <description>I was wondering what is the best way to write a menu driven script?&lt;BR /&gt;I have written some using if statements and some using the case statement. Does it matter as far as performance or is it just personal preference ?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Fri, 29 Jun 2001 19:23:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547080#M875195</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-06-29T19:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Menu scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547081#M875196</link>
      <description>I personally prefer  the case statement for menu scripts.  I think it's a litle easier and cleaner looking.&lt;BR /&gt;&lt;BR /&gt;That's just me though.......</description>
      <pubDate>Fri, 29 Jun 2001 19:30:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547081#M875196</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-06-29T19:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Menu scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547082#M875197</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;Performance in a menu is hardly an issue but clarity is. A long list of if's quickly gets messy but a case statement seldom does.&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Fri, 29 Jun 2001 19:50:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547082#M875197</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-29T19:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Menu scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547083#M875198</link>
      <description>Hi Richard:&lt;BR /&gt;&lt;BR /&gt;There's another very good reason for using 'case' statements in many languages (shell programs among them).&lt;BR /&gt;&lt;BR /&gt;'case' statements can greatly simplify readability of complex blocks of code.  Entire blocks of code, including other 'if' satements can easily be added under each case head (label).  This greatly enhances the ability to augment a script over time with new features without making the script unreadable or untenable to enhance or further maintain.&lt;BR /&gt;&lt;BR /&gt;In shell scripting, file-matching patterns can be used, something that can't be done with an 'if' statement.  For example,&lt;BR /&gt;&lt;BR /&gt;case `ls *.log` in&lt;BR /&gt;  syslog.log )&lt;BR /&gt;...&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 29 Jun 2001 20:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547083#M875198</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-29T20:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Menu scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547084#M875199</link>
      <description>Another choice is the select statement in POSIX and ksh shells. It is a select..do..done type of statement as in:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PS3="/nChoose number:"&lt;BR /&gt;select ANS in new prev next edit exit quit&lt;BR /&gt;do &lt;BR /&gt;case $ANS in&lt;BR /&gt;new) print "New choice";;&lt;BR /&gt;prev) print "Go back";;&lt;BR /&gt;prev|next) print "edit things";;&lt;BR /&gt;exit|quit) break;;&lt;BR /&gt;*) print "Bad choice";;&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;PS3 is the select prompt. Multiple columns are automatically formatted to fit within LINES and COLUMNS.  select is repeated until the script hits a break, exit or return.  TMOUT can be changed to perform a timeout.</description>
      <pubDate>Fri, 29 Jun 2001 21:33:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/menu-scripts/m-p/2547084#M875199</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-06-29T21:33:49Z</dc:date>
    </item>
  </channel>
</rss>

