[gull] Truc et astuces: multithread en bash

felix felix at f-hauri.ch
Tue Feb 16 11:13:13 CET 2021


Ok,

On Mon, Dec 28, 2020 at 08:20:20PM +0100, Daniel Cordey wrote:
> On 28/12/2020 17:01, felix wrote:
> > J'ai pondu, en guise de démo multithread un petit ``multiping'' en bash:
> Toutefois, et sans vouloir me montrer trop maniaque, il s'agit là plutôt de
> multi-processing et non de vrai multi-threading...
J'ai viré le terme ``thread'' des commentaires:
# multiping.sh - V 0.3.01: Simple bash based inter process communication demo

Et j'ai amélioré un poil... (2K -> 8k):

  $ multiping.sh -h
    Usage: multiping.sh [-[cdhp]] [-i N] <host or ip> [host or ip] [host or ip]...
      Options:
        -c    colors (red for no answer, green for higher "seq" number)
        -d    Debug this (by openning 2 xterm windows... look at script)
        -h    help (print this)
        -iN   Interval for ping command (min 0.2 in user mode)
        -p    Plot dynamically (require gnuplot)
        All following argument will be "target" for "ping" command.
    
      When run, this will show all target's answers in a line, sorted by
      IP address (command line order is used, until all IP are knowns)
      A newline is put each time any target upstate change.
      User interactions:
        h     Pring Headline
        p     Start plotting dynamically (unsing gnuplot)
        q     Quit.
        r     Clear terminal
        s     Stop plotting and storring points.

C'est toujours sur
  https://f-hauri.ch/vrac/multiping.sh.txt
  https://f-hauri.ch/vrac/multiping.sh

-- 
 Félix Hauri  -  <felix at f-hauri.ch>  -  http://www.f-hauri.ch


More information about the gull mailing list