How to stop [1] + Stopped (tty input) message and let prog run

How to stop [1] + Stopped (tty input) message and let prog run

Post by atul deuska » Wed, 23 Dec 1998 04:00:00



Hello all,

I run my c-shell script in the background and it keeps
giving
[1] + Stopped (tty input)
and the script stops running. However there is no input required at all
and the output is redirected to a file.
The script runs for few iterations and then displays the above message.

Any idea what could be wrong?

thanks,

Atul

 
 
 

How to stop [1] + Stopped (tty input) message and let prog run

Post by JGM_van_Ra » Thu, 24 Dec 1998 04:00:00



> Hello all,

> I run my c-shell script in the background and it keeps
> giving
> [1] + Stopped (tty input)

Write the C-Shell in the background in sh script.
I mean that your script is maybe csh or ksh.

          Jos van Ras

*** Philips Medical Systems Netherlands
*** System Dev. Cardio/Vascular
*** Hardware, Librarian & Support Unix


*** Homepage:http://www.jgmvanras.demon.nl/

 
 
 

How to stop [1] + Stopped (tty input) message and let prog run

Post by atul deuska » Thu, 24 Dec 1998 04:00:00


?
That worked. Thanks!

Atul



> > Hello all,

> > I run my c-shell script in the background and it keeps
> > giving
> > [1] + Stopped (tty input)

> Write the C-Shell in the background in sh script.
> I mean that your script is maybe csh or ksh.

> ????????? Jos van Ras

> *** Philips Medical Systems Netherlands
> *** System Dev. Cardio/Vascular
> *** Hardware, Librarian & Support Unix


> *** Homepage:http://www.jgmvanras.demon.nl/

 
 
 

How to stop [1] + Stopped (tty input) message and let prog run

Post by Veksler Michae » Thu, 24 Dec 1998 04:00:00




> > Hello all,

> > I run my c-shell script in the background and it keeps
> > giving
> > [1] + Stopped (tty input)

There are several possibilities:
1. Your script is trying to do input.
   This may happen if you write something like:
     set var=
     grep $var filename
   (grep sees `grep filename', and uses 'filename' as the expression
    to look for. This will cause grep to take its input from stdin).
2. Some utilities require control over /dev/tty.
   This may be due to a bug on in purpose (interactive programs do it
   on purpose, "rsh" does it due to some flaw).
   In this case, it may help if you redirect stdin to /dev/null.

   If you had a ksh/sh script, all you had to do was add the following line
   at the beginning:
      exec < /dev/null

   In csh/tcsh things are more ugly. You have 2 choices:
     * Write a wrapper that will call: your_script </dev/null
     * Find the offending command and redirect its input.
       This is the preferred operation, since you need to find the offending
       command anyway in case 1.

Quote:

>  Write the C-Shell in the background in sh script.
>  I mean that your script is maybe csh or ksh.

What do you mean?

   Michael

 
 
 

How to stop [1] + Stopped (tty input) message and let prog run

Post by atul deuska » Wed, 30 Dec 1998 04:00:00


?
Thanks Mike. The wrapper worked better.

Atul




> > > Hello all,

> > > I run my c-shell script in the background and it keeps
> > > giving
> > > [1] + Stopped (tty input)

> There are several possibilities:
> 1. Your script is trying to do input.
> ?? This may happen if you write something like:
> ???? set var=
> ???? grep $var filename
> ?? (grep sees `grep filename', and uses 'filename' as the expression
> ??? to look for. This will cause grep to take its input from stdin).
> 2. Some utilities require control over /dev/tty.
> ?? This may be due to a bug on in purpose (interactive programs do it
> ?? on purpose, "rsh" does it due to some flaw).
> ?? In this case, it may help if you redirect stdin to /dev/null.

> ?? If you had a ksh/sh script, all you had to do was add the following line
> ?? at the beginning:
> ????? exec < /dev/null

> ?? In csh/tcsh things are more ugly. You have 2 choices:
> ???? * Write a wrapper that will call: your_script </dev/null
> ???? * Find the offending command and redirect its input.
> ?????? This is the preferred operation, since you need to find the offending
> ?????? command anyway in case 1.

> >? Write the C-Shell in the background in sh script.
> >? I mean that your script is maybe csh or ksh.

> What do you mean?

> ?? Michael
> ?