You are not logged in.

#1 2011-03-23 22:15:05

jwhendy
Member
Registered: 2010-04-01
Posts: 621

[SOLVED] stop updates in terminal when using 'command &'

Hi,


I've noticed that when I launch an application in urxvt (I guess it might happen elsewhere, just haven't tried other terminals), I get "updates" from those apps, even if I started them in the background with 'command &'. For example:

$ sudo linux32 chroot /opt/arch32
# su username
$ /opt/ibm/lotus/notes/notes &
$ exit
# exit
$ back-to-normal-prompt-at-this-point

But if I keep using that terminal window, every time Lotus Notes does something, I get "updates" about it. Complaints about stale files that it's fixing, etc. Same thing if I am fiddling with conky in the same window I used to start it. I'll be editing it in nano, then save the config, and when it restarts, I get text spit all over the nano window.

Do others have this issue as well? It's as though one must close out of any window used to start a process so it doesn't have a way to interact with you anymore.

Last edited by jwhendy (2011-03-23 23:15:35)

Offline

#2 2011-03-23 22:19:53

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,400
Website

Re: [SOLVED] stop updates in terminal when using 'command &'

foo  &> /dev/null  &

Offline

#3 2011-03-23 22:24:09

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: [SOLVED] stop updates in terminal when using 'command &'

That's simply because the backgrounded command (called a "job" in bash) inherits standard error (stderr) and standard output (stdout) streams from the shell. This is totally natural under *nix systems. If you don't want to see any output from those commands, redirect their output to somewhere else, e.g. /dev/null (nirvana):

$ command &>/dev/null &

The "&>" part redirects both standard output and standard error to /dev/null. See man bash for other possibilities of redirection.

Offline

#4 2011-03-23 23:15:06

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [SOLVED] stop updates in terminal when using 'command &'

@allan & hbekel: thanks for the practical solution and explanation. That's fantastic. It also explains why I've seen that in some PKGBUILDs but had no idea what make had to do with /dev/null before smile

Offline

Board footer

Powered by FluxBB