[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: I'm sure this is a silly question



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 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.           -
----------------------------------------------------------------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]