<?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: How to write a special shell menu ? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900493#M45600</link>
    <description>stty is good ! thanks !</description>
    <pubDate>Fri, 06 May 2005 12:20:30 GMT</pubDate>
    <dc:creator>yyghp</dc:creator>
    <dc:date>2005-05-06T12:20:30Z</dc:date>
    <item>
      <title>How to write a special shell menu ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900491#M45598</link>
      <description>I have a handheld device which can telnet to our Unix/Linux servers to run an application, it has a full functional keyboard with all keys.&lt;BR /&gt;I need to force all users who login to the servers via such device to run a shell script right after they login, without prompting the commandline, like this:&lt;BR /&gt;&lt;BR /&gt;************************&lt;BR /&gt;1.  Run Application&lt;BR /&gt;2.  Change Password&lt;BR /&gt;3.  Logout&lt;BR /&gt;************************&lt;BR /&gt;&lt;BR /&gt;I need to restrict all users to access only the options above, they should not be able to do anything else except the actions above.&lt;BR /&gt;How to prevent them from using "Ctrl + C" or something else to break the shell and going into the Prompt. That is, they don't need to run "ls", "vi"... It's a security approach.&lt;BR /&gt;And how to return back to such menu after users exit the application ?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Fri, 06 May 2005 08:16:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900491#M45598</guid>
      <dc:creator>yyghp</dc:creator>
      <dc:date>2005-05-06T08:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a special shell menu ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900492#M45599</link>
      <description>In the user's profile (.bashrc or .profile or whatever), put commands similar to these:&lt;BR /&gt;&lt;BR /&gt;display_menu() {&lt;BR /&gt;clear&lt;BR /&gt;echo "*********************"&lt;BR /&gt;echo "1. Run Application"&lt;BR /&gt;echo "2. Change Password"&lt;BR /&gt;echo "3. Logout"&lt;BR /&gt;echo "*********************"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# this disables the ^C interrupt&lt;BR /&gt;#&lt;BR /&gt;stty intr undef&lt;BR /&gt;&lt;BR /&gt;display_menu&lt;BR /&gt;&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;case $LINE in&lt;BR /&gt;1) /path/to/application&lt;BR /&gt;;;&lt;BR /&gt;2) passwd&lt;BR /&gt;;;&lt;BR /&gt;3) exit&lt;BR /&gt;;;&lt;BR /&gt;*)&lt;BR /&gt;echo "Invalid option.  Press enter to return to menu."&lt;BR /&gt;read JUNK&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;display_menu&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Simply put, this will loop forever, taking a value 1, 2 or 3 followed by an Enter.  When the application or password change is complete, it'll clear the screen and re-display the menu.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of course, you can make it as pretty or ugly as you desire, but that's the basics of it.</description>
      <pubDate>Fri, 06 May 2005 08:27:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900492#M45599</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-05-06T08:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a special shell menu ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900493#M45600</link>
      <description>stty is good ! thanks !</description>
      <pubDate>Fri, 06 May 2005 12:20:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-write-a-special-shell-menu/m-p/4900493#M45600</guid>
      <dc:creator>yyghp</dc:creator>
      <dc:date>2005-05-06T12:20:30Z</dc:date>
    </item>
  </channel>
</rss>

