Re: Pushing commands to the background

2003-03-18 Thread Nikolay Y. Orlyuk
On Mon, Mar 17, 2003 at 09:08:57PM -, Chris Phillips wrote:
 
 
 Stuff like: -
 
 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
 :-(
You forgot about HUP

`nohup' will vacinate from SIGHUP (#1)


look nohup(1)

bash also have disown

-- 
With best wishes Nikolay
mail: [EMAIL PROTECTED]


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


Re: Pushing commands to the background

2003-03-17 Thread Rus Foster
On Mon, 17 Mar 2003, Chris Phillips wrote:

 Hello all,

 I'm not sure if it's exactly On Topic (I bet you'll let me know!), but
 here goes...

 I work in technical support, for a FreeBSD based, Internet Appliance 
 am after a way to gather some network quality information.

 I'd like to run some commands, one after another, have the output(s)
 added (appended) to a file, then, when all is complete, have that file
 sent to my email address.  I can then compile the data  make some sense
 of it, maybe...

 Stuff like: -

 hostname
 uptime
 ping -c 100 ftp.furrie.net
 traceroute ftp.furrie.net


Well you can do something like

(hostname ; uptime ; ping ; traceroute )  file

You might also find the tee command useful

Rgds

Rus
--
http://www.65535.net | MSN: [EMAIL PROTECTED] | e: [EMAIL PROTECTED]
  More bits for your bite
Lifetime FreeBSD + Linux Hosting and Shell Accounts
 Please respect RFC1855 and don't top post

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


Re: Pushing commands to the background

2003-03-17 Thread Steve Bertrand
 I'm not sure if it's exactly On Topic (I bet you'll let me know!), but
 here goes...

 I work in technical support, for a FreeBSD based, Internet Appliance 
 am after a way to gather some network quality information.

 I'd like to run some commands, one after another, have the output(s)
 added (appended) to a file, then, when all is complete, have that file
 sent to my email address.  I can then compile the data  make some sense
 of it, maybe...

 Stuff like: -

 hostname
 uptime
 ping -c 100 ftp.furrie.net
 traceroute ftp.furrie.net


without testing, try something like this:

# hosname  outputfil  uptime  outputfil  \
ping -c ftp.furrie.net  outputfil  \
traceroute ftp.furrie.net  outputfil  \
mail -s myoutput [EMAIL PROTECTED]  outputfil  \
rm outputfil 

The single  pushes the command to the background and the double  is an
AND operator, telling the system to run one command AND then this one AND
then this one etc. This is one command, ignore the \. Just type it out as
one string.

Hope this works!

Steve


 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
 :-(

 Please can somebody help me?  Even if it's just to give me another place
 to ask my question...

 Many Thanks Everyone!


 Chris Phillips

 PS.  I often write emails to [EMAIL PROTECTED], but rarely
 send them, as I read my questions before sending  often find much
 better results when googling with my questions.


 intY has scanned this email for all known viruses (www.inty.com)



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




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


Re: Pushing commands to the background

2003-03-17 Thread Mike Meyer
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


Re: Pushing commands to the background

2003-03-17 Thread Kevin Stevens
 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 screen utility, among other functions, gives you the ability to
disconnect/reconnect to a running session.  It's in ports.

KeS



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


Re: Pushing commands to the background

2003-03-17 Thread Edmond Baroud
hi

On Mon, 17 Mar 2003 21:08:57 -
Chris Phillips [EMAIL PROTECTED] wrote:

 Hello all,
 
 I'm not sure if it's exactly On Topic (I bet you'll let me know!), but
 here goes...
 
 I work in technical support, for a FreeBSD based, Internet Appliance 
 am after a way to gather some network quality information.
 
 I'd like to run some commands, one after another, have the output(s)
 added (appended) to a file, then, when all is complete, have that file
 sent to my email address.  I can then compile the data  make some sense
 of it, maybe...
 
 Stuff like: -
 
 hostname
 uptime
 ping -c 100 ftp.furrie.net
 traceroute ftp.furrie.net

copy this and put it in myscript.sh:
#!/bin/sh
hostname  /tmp/myscript.$$
uptime  /tmp/myscript.$$
ping -c 100 ftp.furrie.net  /tmp/myscript.$$
traceroute ftp.furrie.net  /tmp/myscript.$$
mail -s myscript's output [EMAIL PROTECTED]
rm /tmp/myscript.$$

chmod u+x myscript.sh
/myscript.sh  (will do give you the command prompt back, it's the ping -c 100 that 
was keeping u from getting back to the prompt, u had to wait until it finishes the -c 
count)

Ed.

 
 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
 :-(
 
 Please can somebody help me?  Even if it's just to give me another place
 to ask my question...
 
 Many Thanks Everyone!
 
 
 Chris Phillips
 
 PS.  I often write emails to [EMAIL PROTECTED], but rarely
 send them, as I read my questions before sending  often find much
 better results when googling with my questions.
 
 
 intY has scanned this email for all known viruses (www.inty.com)
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-questions in the body of the message
 


-- 
Edmond Baroud 
UNIX Systems Admin mailto:[EMAIL PROTECTED]
Fingerprint  140F 5FD5 3FDD 45D9 226D  9602 8C3D EAFB 4E19 BEF9
UNIX is very user friendly, it's just picky about who its friends are.



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