[lug] Bash Scripting Ping

Jeffrey S. Haemer jeffrey.haemer at gmail.com
Sun Nov 8 11:01:45 MST 2020


D.,

For those of me who're first reading your question while sitting in a
coffee shop at a Mac laptop, could you just say what the flags are
doing, so's I can make sure I understand the problem by trying something
similar?


On Sun, Nov 8, 2020 at 10:53 AM D. Stimits <stimits at comcast.net> wrote:

> I am curious about something in bash scripting which does not seem to be
> particularly easy. I wanted to script "ping -O -D address" such that each
> line gets processed by some logic if the ping fails. Redirecting ping to a
> variable does not work because it only "returns" when the ping exits (each
> line is not an exit). Even if I were to fork and exec, the forked process
> would itself have the same problem.
>
> Is there some simple/clever way to process each line of a ping in bash
> without killing off the ping itself? My goal was to send it through some
> database and statistics type processing as success/failure lines occur.
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety



-- 
Jeffrey Haemer <jeffrey.haemer at gmail.com>   720-837-8908 [cell]
*פרייהייט? דאס איז יאַנג דינען וואָרט!*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20201108/f9cf0aff/attachment.html>


More information about the LUG mailing list