I agree: python seem to be more apropriated language for complex operation.
Anyway, bash already offer a lot of features (like `coproc` and `read -t 0`) usefull for IPC. I wrote a little ``multiping`` bash script, as multithread demo, running many parallels ping, reading all outputs and merging them in one line. Sample: (Hitting `q` after ~4 seconds) $ multiping.sh www.google.com www.archlinux.org www.f-hauri.ch Started: PING www.google.com (172.217.168.68) 56(84) bytes of data. Started: PING www.archlinux.org (95.217.163.246) 56(84) bytes of data. Started: PING www.f-hauri.ch (62.220.134.117) 56(84) bytes of data. www.google.com www.archlinux.org www.f-hauri.ch 11:00:10 1 12.6 1 46.10 1 9.27 11:00:11 2 12.0 2 47.4 2 9.24 11:00:12 3 12.7 3 47.6 3 9.22 11:00:18 4 10.8 4 46.5 4 9.40 www.google.com 4 / 4 -> 0%err. 10.822/12.017/12.661/0.734 ms www.archlinux.org 4 / 4 -> 0%err. 46.466/47.125/47.632/0.493 ms www.f-hauri.ch 4 / 4 -> 0%err. 9.219/9.282/9.404/0.120 ms You could find them there: https://f-hauri.ch/vrac/multiping.sh.txt https://f-hauri.ch/vrac/multiping.sh On Sun, Dec 27, 2020 at 08:26:49PM +0100, Léa Gris wrote: > On 27/12/2020 at 19:30, Saint Michael wrote: > > Yes, superglobal is great. > > Maybe you should consider that Bash or shell is not the right tool for your > needs. > > If you need to manipulate complex objects, work with shared resources, Bash > is a very bad choice. If you want to stay with scripting, as you already > mentioned using Python; Python is a way better choice for dealing with the > features and requirements you describes. -- Félix Hauri - <fe...@f-hauri.ch> - http://www.f-hauri.ch