In <[EMAIL PROTECTED]>, Chris Phillips <[EMAIL PROTECTED]> typed:
> 
> hostname
> uptime
> ping -c 100 ftp.furrie.net
> traceroute ftp.furrie.net
> 
> I'd like to push all the commands into the background & be able to log
> off and let it do its business unattended.  Unfortunately, with my
> lacking knowledge, so far I have managed this, (sad isn't it)...
> 
> (ping -c 10 ftp.furrie.net > /tmp/results && cat /tmp/results | mail
> [EMAIL PROTECTED] &)
> 
> Even with an & at the end of this command, I do not get my prompt back
> :-(

The easiest oneliner is:

(hostname; uptime; ping -c 100 ftp.furrie.net; traceroute ftp.furrie.net) | mail 
[EMAIL PROTECTED] &

The reason your one-liner didn't come back fromm the background is
that you didn't background the shell running the command, but
backgrounded the commands the shell was waiting on.

Putting a bunch of commands in parens separated by ; runs them one
after the other in a subshell, with output going to standard
output. Just send that output to mail and you're done.

        <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>          http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to