<?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: to exit a script.. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492981#M19744</link>
    <description>One thing I did was put exit in the .profile&lt;BR /&gt;The seemed to work unless they did a Cntrl-C &lt;BR /&gt;to break out of a running app.</description>
    <pubDate>Tue, 13 Feb 2001 15:32:33 GMT</pubDate>
    <dc:creator>someone_4</dc:creator>
    <dc:date>2001-02-13T15:32:33Z</dc:date>
    <item>
      <title>to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492980#M19743</link>
      <description>I have attached a script that I wrote for tech support to check and trouble shoot my sendmail server. The point of this is so that they dont have to know Hp-UX or sendmail and the job can still be done. I created a user in the server that they log into and the script is in the .profile . But  what happens is when they exit the script they hit a command line. And then have to type exit. I would like it to where they dont see a command line. And when they do a Q that it will log them off the server. Any ideas?&lt;BR /&gt;thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Feb 2001 15:30:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492980#M19743</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-02-13T15:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492981#M19744</link>
      <description>One thing I did was put exit in the .profile&lt;BR /&gt;The seemed to work unless they did a Cntrl-C &lt;BR /&gt;to break out of a running app.</description>
      <pubDate>Tue, 13 Feb 2001 15:32:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492981#M19744</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-02-13T15:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492982#M19745</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;You could use&lt;BR /&gt;trap "exit 0" INT QUIT ABRT KILL&lt;BR /&gt;instead of trap "echo... " 2&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Feb 2001 15:39:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492982#M19745</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-13T15:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492983#M19746</link>
      <description>Hi Richard:&lt;BR /&gt;&lt;BR /&gt;In the $HOME/.profile at the end, do:&lt;BR /&gt;&lt;BR /&gt;exec &lt;YOURSCRIPT&gt;&lt;/YOURSCRIPT&gt;&lt;BR /&gt;When the user exit's your script, they will be logged off.  When the user you have created for this purpose logs on, your script will automatically be run.  For added protection, at the beginning of the profile, add the following:&lt;BR /&gt;&lt;BR /&gt;trap "" 1 2 3&lt;BR /&gt;&lt;BR /&gt;This will keep the smart user from breaking into a shell as the profile is sourced during the login.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 13 Feb 2001 15:41:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492983#M19746</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-13T15:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492984#M19747</link>
      <description>no that didnt work. If I am looking at a log&lt;BR /&gt;and do cntrl-c to break out it give me a command line.</description>
      <pubDate>Tue, 13 Feb 2001 15:45:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492984#M19747</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-02-13T15:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492985#M19748</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;Near the beginning of your script, you could "undefine" the interrupt using:&lt;BR /&gt;stty intr ^-&lt;BR /&gt;&lt;BR /&gt;Don't forget to undefine susp and dsusp as well, otherwise job control will still be possible.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Feb 2001 15:56:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492985#M19748</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-13T15:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492986#M19749</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;what about putting the script into passwd as the login(shell) ?&lt;BR /&gt;BTW: You use 'more' in your script to view mail.log and if more stops for next page the user could get a shell prompt with !&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 13 Feb 2001 16:00:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492986#M19749</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-02-13T16:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492987#M19750</link>
      <description>James thanks for your help that worked great!&lt;BR /&gt;I was wondering if you could tell me why that works?</description>
      <pubDate>Tue, 13 Feb 2001 17:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492987#M19750</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-02-13T17:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492988#M19751</link>
      <description>Richard:&lt;BR /&gt;&lt;BR /&gt;'exec &lt;ARG&gt;' replaces the current shell with a new shell or a program (in your case) without spawning a new process or subshell.&lt;BR /&gt;&lt;BR /&gt;When you exit that exec'ed process, there is nothing to which to return.&lt;BR /&gt;&lt;BR /&gt;The 'trap' command catches the interrupts (signals) we want to handle.  As coded, it does nothing, so it serves as a "no-op" to the user, defeating his/her use of the keyboard interrupts during login and for the exec'ed script.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/ARG&gt;</description>
      <pubDate>Tue, 13 Feb 2001 17:46:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492988#M19751</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-13T17:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: to exit a script..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492989#M19752</link>
      <description>Hi Richard:&lt;BR /&gt;&lt;BR /&gt;BTW : The point that Andreas makes is a very good one! [and you should credit him generously with points!!!]. In the mechanism I presented, it is possible when you use commands like 'more' and 'elm', to invoke a shell from them.  As Andreas suggests, an alternative is to replace the usual shell declaration, in the /etc/passwd entry for the user in question, with the name of your script.  Then, if the script invokes 'more', for instance, to invoke a shell, the user will be rewarded merely with yet another instantiation of your script!  Once your script is exited, the user will be logged off with either this mechanism, or the one I suggestsed originally.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 13 Feb 2001 19:44:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-exit-a-script/m-p/2492989#M19752</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-13T19:44:15Z</dc:date>
    </item>
  </channel>
</rss>

