> > Hello all,
> > I run my c-shell script in the background and it keeps
> > giving
> >  + Stopped (tty input)
There are several possibilities:
1. Your script is trying to do input.
This may happen if you write something like:
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?