From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Karr Newsgroups: gmane.emacs.help Subject: Re: How to avoid having shell scripts which fail from killing Emacs shell? Date: Mon, 22 Jun 2009 13:21:02 -0700 (PDT) Organization: http://groups.google.com Message-ID: <92bcc449-5616-4e2b-99dc-2f1dac3fde1c@y10g2000prc.googlegroups.com> References: <88ba12ed-8f02-4f3e-bb30-cc6155a38df2@f38g2000pra.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1245703263 603 80.91.229.12 (22 Jun 2009 20:41:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 20:41:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 22 22:41:01 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIqK3-00045t-At for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jun 2009 22:41:00 +0200 Original-Received: from localhost ([127.0.0.1]:54829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIqK2-000259-Le for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jun 2009 16:40:58 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!y10g2000prc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 207.188.29.244 Original-X-Trace: posting.google.com 1245702062 13599 127.0.0.1 (22 Jun 2009 20:21:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 22 Jun 2009 20:21:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y10g2000prc.googlegroups.com; posting-host=207.188.29.244; posting-account=78dYpQkAAABkXq5R--mk7bpN1x43kmXK User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729), gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:170217 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65436 Archived-At: On Jun 19, 4:03=A0pm, David Karr wrote: > I've often been annoyed by shell scripts which fail for particular > reasons, at which point it causes my Emacs shell buffer to get killed, > with "Process shell<2> finished". =A0I think it's possible I could code > the script to make this not happen, but it would make more sense > (especially when I didn't write the script) to configure Emacs or the > Bash inside Emacs, so that it doesn't get killed when a script it's > running fails. > > What are my options for mitigating this? For a little more background, note that the script in question gathers some simple parameters and then calls a Java class, which in my test case, throws an exception because I'm giving it a file path that doesn't exist (deliberately). I note that even though the Java class throws an exception, it doesn't cause the script to exit at that point. I tried putting an "echo" right after the Java call, and it executes fine. Right after that (as it's the last line in the script), the script exits, and at my shell prompt, I see "% exit" (where "%" is my PS1), and my shell buffer terminates.