I'm sure this is a silly question

Rick Stevens rstevens at vitalstream.com
Thu Apr 7 22:20:34 UTC 2005


Kostas Sfakiotakis wrote:
> Greetings ,
> 
> Rick Stevens wrote:
> 
> < snip >
> 
>>>
>>> Put an ampersand after your command to run it in the background. For 
>>> example, you can type this in console:
>>>
>>> gedit &
>>>
>>> Now if you close the console, gedit will still be running.
>>
>>
>>
>> Better yet:
>>
>>     gedit >/dev/null 2>&1 &
>>
>> (redirect both stdout and stderr to /dev/null and run program in
>> background).
> 
> 
> Rick, by sending both stdout and stderr to /dev/null wouldn't you
> prevent gedit ( or whatever the application is ) from printing an error
> message should an error condition, or even an application crash  occur ?

Yes, it would, but so does closing the console.  If one needs to save
stdout and stderr, they could be directed to files instead of /dev/null
or the program could be run under "nohup":

	nohup gedit &

in which case stdout and stderr get sent to "current_dir/nohup.out".
See nohup(1).
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-    They say when you play a Microsoft CD backwards, you'll hear    -
-   Satanic messages, but if you play it forwards, it will install   -
-           Windows...which means Satan is in your system.           -
----------------------------------------------------------------------




More information about the fedora-list mailing list