Why won't scripts run in the background?

Vick Khera khera at juliet.cs.duke.edu
Tue Apr 10 11:24:04 AEST 1990


In article <1990Apr9.212425.6452 at aucs.uucp> 880139h at aucs.UUCP (Rob Hu10) writes:
>This has been bugging me for just about too long.  I've even asked 
>all the local smart fellers and none of them have any ideas.  So,
>I post my question:
>
>WHY WON'T ANY @$#%$!!! SHELL SCRIPTS RUN IN THE BACKGROUND SUCCESFULLY
>ON MY ACCOUNT WHEN THE _SAME_ SCRIPTS RUN JUST DANDY IN OTHER FOLK'S
>ACCOUNTS????!!!!!
>
>If I set up a script to run in the background, eg. scriptname &,
>it runs just fine until I type a command or just <return>.  The error
>message I get is :
>
>[1] +Stopped  (tty output)  scriptname
>
>Or some such thing.
>
>I'm runing SunOS on a Sun4.  I've included my .cshrc file incase it's
>something in there.  Anyone have any ideas?  PLEEEEEEEEAAASE?
>Thank you very much.
>------  my .cshrc -------
> [ ... ]
>
>stty erase ^H
> [ ... ]

this is the culprit.  stty wants to output information to your tty but
can't.  something like the following at the start of your .cshrc file
should help. also, you may wish to make sure your shell script start with

#!/bin/csh -f

so your .cshrc file is not executed anyway.
place this at the top of your .cshrc file:

# if non-interactive, do not set up aliases, etc., but set path.
if ($?prompt == 0) then
	umask 022
	source ~/.setpath
	exit
endif


>Rob Hutten : 880139h at aucs.uucp      542-1686/678-7088  Wolfville, NS, Canada
			   ^^^^ get a more useful address. i can't mail
directly to you using this one (which i would have preferred in this case).

								v.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vick Khera           (919) 660-6528     Department of Computer Science
ARPA:   khera at cs.duke.edu               Duke University
UUCP:   ..!{mcnc,decvax}!duke!khera     Durham, NC 27706



More information about the Comp.unix.questions mailing list