<?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: Session is closing in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714936#M61564</link>
    <description>Hi Stephenson ,&lt;BR /&gt;   Thanks for the clue. Can you give any alternative or other way to exit from the menu ,but not from the telnet session.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Wed, 01 May 2002 15:07:20 GMT</pubDate>
    <dc:creator>Chandramani</dc:creator>
    <dc:date>2002-05-01T15:07:20Z</dc:date>
    <item>
      <title>Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714932#M61560</link>
      <description>Hi there,&lt;BR /&gt;   I wrote a small scipt which will give a small menu.And the last option is exit.It is working fine when I am just excuting like this.&lt;BR /&gt;./bv_tools&lt;BR /&gt;&lt;BR /&gt;but when I tried to source into my shell it is killing my telnet screen and closing all the windows&lt;BR /&gt;. ./bv_tools&lt;BR /&gt;---------------------------------&lt;BR /&gt;Here is the code which I wrote for exit:&lt;BR /&gt;&lt;BR /&gt;    echo "                     x)  Exit"&lt;BR /&gt;    echo&lt;BR /&gt;    echo&lt;BR /&gt;    echo "   Your Selection : \c "&lt;BR /&gt;    read CHOICE&lt;BR /&gt;    if [ "${CHOICE}" = x ]&lt;BR /&gt;    then&lt;BR /&gt;       clear&lt;BR /&gt;       exit 0&lt;BR /&gt;    else&lt;BR /&gt;       clear&lt;BR /&gt;        (( k = "$CHOICE - 1" ))&lt;BR /&gt;       ${MENUCOMMAND[$k]}&lt;BR /&gt;    fi&lt;BR /&gt;-----------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What could be the reason???&lt;BR /&gt;&lt;BR /&gt;Please help me to solve the issue.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;-Chandramani</description>
      <pubDate>Wed, 01 May 2002 14:48:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714932#M61560</guid>
      <dc:creator>Chandramani</dc:creator>
      <dc:date>2002-05-01T14:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714933#M61561</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;This is a case of the shell doing exactly what you ask it to do.&lt;BR /&gt;&lt;BR /&gt;When you execute as ./bv_tools, bv_tools is run as a separate process so that the exit only applies to the shell executing bv_tools BUT when your source it as '. ./bv_tools' then this is run in the current shell and as soon as you exit you actually exit the current shell. NEVER use exits in sourced files (unless you truly want to exit the foreground process).&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2002 14:57:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714933#M61561</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-05-01T14:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714934#M61562</link>
      <description>Hi your exit statement looks good. Can you send in the full code just to verify if everything looks good above and below the script.</description>
      <pubDate>Wed, 01 May 2002 14:58:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714934#M61562</guid>
      <dc:creator>ashish nanjiani</dc:creator>
      <dc:date>2002-05-01T14:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714935#M61563</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you run ./bv_tools,&lt;BR /&gt;the shell will create a child process, so your 'exit' command will simply tell the child process to exit, and you will be returned to the shell.&lt;BR /&gt;&lt;BR /&gt;But if you run '. ./bv_tools', it's as if you type each line of your script at the command line.  So, your 'exit' command  will actually exit your shell.&lt;BR /&gt;&lt;BR /&gt;If you need to test your script with the "dot" command,  you can run 'sh' to open another shell first.  Then '. ./bv_tools will terminate by exiting that shell, and you will be returned to your original shell.&lt;BR /&gt;&lt;BR /&gt;Mlade</description>
      <pubDate>Wed, 01 May 2002 15:04:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714935#M61563</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2002-05-01T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714936#M61564</link>
      <description>Hi Stephenson ,&lt;BR /&gt;   Thanks for the clue. Can you give any alternative or other way to exit from the menu ,but not from the telnet session.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 01 May 2002 15:07:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714936#M61564</guid>
      <dc:creator>Chandramani</dc:creator>
      <dc:date>2002-05-01T15:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714937#M61565</link>
      <description>You can run:&lt;BR /&gt;&lt;BR /&gt;sh -c ./bv_tools&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2002 15:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714937#M61565</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2002-05-01T15:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714938#M61566</link>
      <description>All of the answers you received are valid. My personal preference would lead me to build the menu into a case statement.&lt;BR /&gt;&lt;BR /&gt;print " 1) Say Hello "&lt;BR /&gt;print " 2) Say Goodbye "&lt;BR /&gt;print " 3) Exit "&lt;BR /&gt;&lt;BR /&gt;print -n "Please select your choice: "&lt;BR /&gt;read choice&lt;BR /&gt;case $choice in&lt;BR /&gt;  1) say_hello_function;;&lt;BR /&gt;  2) say_goodbye_function;;&lt;BR /&gt;  3) leave_function;; &lt;BR /&gt;  *) print " Sorry, bad choice "&lt;BR /&gt; esac          &lt;BR /&gt;           # you cannot use exit&lt;BR /&gt;           # as the name of a&lt;BR /&gt;           # function as like a meta &lt;BR /&gt;           # character it has special meaning &lt;BR /&gt;&lt;BR /&gt;you can source these functions in a couple of different ways ( ie: functions in the same file above the case statement or functions in a "referenced" file like .filenamerc. &lt;BR /&gt;&lt;BR /&gt;I personally like the .filenamerc method but it really doesn't matter.&lt;BR /&gt;&lt;BR /&gt;jiin</description>
      <pubDate>Wed, 01 May 2002 17:39:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714938#M61566</guid>
      <dc:creator>Gerald Bush_2</dc:creator>
      <dc:date>2002-05-01T17:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714939#M61567</link>
      <description>You're running it in the parent shell. Like exec does. When the script exits it's shell exits which is your only shell and therefore you get logged off.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Wed, 01 May 2002 18:20:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714939#M61567</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2002-05-01T18:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714940#M61568</link>
      <description>Hi,&lt;BR /&gt;  I solved that problem by putting die() in place of exit 0.&lt;BR /&gt; I don't know whether it is correct or not,but it is working for me.If anyone knows more about die(),please explain little more.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Thu, 02 May 2002 02:05:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714940#M61568</guid>
      <dc:creator>Chandramani</dc:creator>
      <dc:date>2002-05-02T02:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Session is closing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714941#M61569</link>
      <description>Won't you achieve the same result by simply commenting out the exit statement?</description>
      <pubDate>Thu, 02 May 2002 02:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/session-is-closing/m-p/2714941#M61569</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-05-02T02:28:26Z</dc:date>
    </item>
  </channel>
</rss>

