help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid having shell scripts which fail from killing Emacs shel


From: David Karr
Subject: Re: How to avoid having shell scripts which fail from killing Emacs shell?
Date: Mon, 22 Jun 2009 16:38:45 -0700 (PDT)
User-agent: G2/1.0

On Jun 22, 3:49 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 22.06.2009 um 22:21 schrieb David Karr:
>
> > 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.
>
> OK, I do remember similiar events! It was in tcsh. And there were two  
> or three problems: a script was running wild, I was typing C-c or  
> such wildly, and ... well, it could have been in cpan (filling up my  
> root and boot file system). Anyway, in the end I saw the shell die,  
> and at this moment it's not possible to gain more information. There  
> were also events outside cpan. I do remember that I made mistakes,  
> typing C-d for example. There could be one plausible cause: when you  
> type input and your script is not prepared to read this, then GNU  
> Emacs has to save it. Maybe this period is limited. And then  
> something irregular could happen. I have no real idea, but what you  
> encounter is not impossible. (And maybe Cygwin adds something to make  
> it happen, it's an emulation in a host operating system.)

Well, this did give me one idea that gave me a clue, but I don't know
what to do with this clue.

I tried writing a simple class that takes a command-line arg as a
filepath.  I get it to throw an exception, but it doesn't kill the
shell.

I then changed the class to additionally read a line of text from
stdin, in addition to taking the filepath.  When I test this, whether
the command-line file path exists or not, it still kills the shell at
the end of the script.  So, the key is that the sub-shell reads
input.  I have no idea what to do with that information, but I'm sure
it's a useful clue.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]