bug-bash
[Top][All Lists]
Advanced

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

Re: bash script in background gets interrupted if carriage return is hit


From: Bob Proulx
Subject: Re: bash script in background gets interrupted if carriage return is hit...
Date: Fri, 12 Oct 2007 14:55:50 -0600
User-agent: Mutt/1.5.13 (2006-08-11)

Ken Failbus wrote:
> I have a script that when run in background and while it's running
> hitting a carriage return causes it's to completely stop the script and
> the terminal in which it's running disappears. It seems as though it
> received a interrupt signal. Is there some kind of a job control or
> terminal keys getting mis-represented.

Strange.  What system are you running on?  Who built your version of
bash?  Yourself or the system?

I would start by checking your tty settings.  I have seen them become
incorrect where other keys were assigned to send signals.

  $ stty -a

Second I would run the script in a second shell.  That way when the
first one exits it will fall back to the second one and the terminal
won't disappear.  Your terminal is probably exiting because the shell
exited.  Stacking another shell should prevent that.

  $ bash
  $ yourscript &
  ...blah..blah...
  $

You could run your session in a 'script' session to record all input
and output from it.  'man script' for details.  Basically simply run
'script' which stacks a shell with all output being logged to a file
"typescript" where it can be reviewed later.

  $ script
  $ yourscript &
  ...blah..blah...
  $ less typescript

And if none of those things turn up anything interesting then it is
time to look at what the script itself is doing.

Bob




reply via email to

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