Shell script

Jerry Feldman Gerry.Feldman at compaq.com
Wed Jun 14 09:24:18 EDT 2000


I don't understand exactly what you are trying to do. I assuming you are 
using the grep 64 to simply extract the pings and not the other crap, 
such as the header and result. I don't understand why you expect the 
number 5?
if I use the command:x=` ping -c 5 entil-zha | grep 64`
Where the single quotes are the grave accent which causes the 
command to be executed, not the single quotes, I would expect x to 
contain:
64 bytes from 192.168.3.23: icmp_seq=0 ttl=255 time=0 ms 64 bytes 
from 192.168.3.23: icmp_seq=1 ttl=255 time=0 ms 64 bytes from 
192.168.3.23: icmp_seq=2 ttl=255 time=0 ms 64 bytes from 
192.168.3.23: icmp_seq=3 ttl=255 time=0 ms 64 bytes from 
192.168.3.23: icmp_seq=4 ttl=255 time=0 ms




On 14 Jun 2000, at 8:42, Anthony J. Gabrielson wrote:

> Okay know I don't feel so bad.  For some reason this is not working.  My
> command is ping -c 5 bacon | grep 64 - when I assign it var='ping cmd'
> then echo $var - it echos the command, not the answer I'm expecting 5.  I
> haven't had to due much shell sccripting so I could be missing something
> big.
> 
> As always all help appreciated.
> 
> Thanks,
> Anthony
> 
> On Tue, 13 Jun 2000, Anthony J. Gabrielson wrote:
> 
> > Hello,
> > 	I have what I hope to be an easy question.  How do I make the
> > output of a command, it will be a number, assign to a variable.  I'm using
> > bash - I have been reading through several books on this and I'm starting
> > to get frusterated.
> > 
> > Thanks,
> > Anthony
> > 
> > -
> > Subcription/unsubscription/info requests: send e-mail with
> > "subscribe", "unsubscribe", or "info" on the first line of the
> > message body to discuss-request at blu.org (Subject line is ignored).
> > 
> 
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).


--
Jerry Feldman
Contractor, eInfrastructure Partner Engineering   
508-467-4315 http://www.testdrive.compaq.com/linux/

Compaq Computer Corp.
200 Forest Street MRO1-3/F1
Marlboro, Ma. 01752
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list