On Tue, Aug 05, 2003 at 07:28:05PM -0700, Mark K. Kim wrote: > hi guys. so when i launch an app in the background and i kill it like > this: > > $kill $pid > $ > > then it displays something like: > > $ > [1]+ Terminated xv > > but if i'm doing this in a script, i want the display to not appear at > all. how do i stop this message from displaying? thanks in adv!
This message is only displayed for a "job" of the shell's. And it's only displayed when bash gets ready to display a shell prompt. I may be wrong, but I don't think it gets displayed in noninteractive shells (such as one used to run a script). But it *definitely* won't display for a "disown"ed process which is no longer considered a "job". "disown" is a bash builtin which disassociates a job from the current shell. I use it (indirectly) quite a lot: I frequently find it convenient to launch GUI apps from the command-line; however, I don't like 'em cluttering up the job list, as my customized bash prompt lists current jobs and their job numbers. For instance, my current prompt (after suspending mutt) looks like: [32mmicah([31m1[1;33mmutt[0;32m)$[0m (If you can't read the above, or it just looks like inverted text, try piping this mail through "less -r" or something). Or, for those whose mail-readers won't allow the interpretation of the ANSI codes above: micah(1mutt)$ ^^^^^^*----^^ Where the different underscoring characters denote distinguishing colors (on the FreeBSD machine I'm shelled into at the moment, that's green, red, and bold-yellow, respectively). I find this handy to keep various console-oriented programs suspended and switch between them; but I don't like having my background processes showing up there. So I use a small script named "spawn" which simply launches the command in the background and disowns it (I think it uses nohup, too - can't remember). disown is a builtin, though, so only available for bash, though other programs may also have a disown command or similar. Also, disown hasn't always been around, and may not be available in older versions of bash. HTH, -Micah _______________________________________________ vox-tech mailing list [EMAIL PROTECTED] http://lists.lugod.org/mailman/listinfo/vox-tech
