Starting program in background...
Kevin D. Kinsey, DaleCo, S.P.
kdk at daleco.biz
Tue Aug 10 06:39:11 PDT 2004
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 at 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
More information about the freebsd-newbies
mailing list