Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 2004 08:36:50 -0500
From:      "Kevin D. Kinsey, DaleCo, S.P." <kdk@daleco.biz>
To:        DerAlSem <deralsem@inbox.ru>
Cc:        freebsd-newbies@freebsd.org
Subject:   Re: Starting program in background...
Message-ID:  <4118CF72.7010702@daleco.biz>
In-Reply-To: <1371689745.20040810114424@inbox.ru>
References:  <BAY10-F46xw0ogeftaj0000d80b@hotmail.com> <200408100923.54206.stevan.tiefert@freenet.de> <1371689745.20040810114424@inbox.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
DerAlSem wrote:

>How can i run program in background? It cannot be run as a deamon. I
>read in manual, that i should use "screen" command. But this prog is
>port from linux, and it seems, there's no screen command under
>FreeBSD. Starting with "&" parametr have no effect... It's giving me
>pid, but program continues output to console...
>
>  
>
 Hello,

Technical questions should be posted to the questions@freebsd.org
list (which I am cc'ing).

I assume that you are being told to use the "screen" port
/usr/ports/misc/screen, which is a GNU program.  I don't
know much about that.  You could also use script(1), which
was designed for this sort of thing.

And yes, you could use "&" and console redirection...

% somecommand > /home/me/logfile &

This works under either the Bourne or C shells and would
send "somecommand" into the background under shell
job control and send all stdout to the logfile.  Error messages,
however, would still be written to console. 

If you use Bourne shell, you can redirect both stdout
and stderr by doing it this way:

$ somecommand> /home/me/logfile 2>&1

But csh/tcsh doesn't like that, so script(1) is the better
option.

HTH,

Kevin Kinsey



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4118CF72.7010702>