fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a0d8d27f4
master
1# RUN: fish=%fish %fish %s 2 3set -g nproc( 4if command -v nproc> /dev/null 5nproc 6else 7sysctl -n hw.logicalcpu 8end 9) 10function run-concurrently 11for iin ( seq ( math "10 * min( $nproc , 16)" )) 12$fish -c$argv [ 1 ] & 13end 14wait 15end 16 17run-concurrently ' 18set t "$( 19command echo -n A 20echo -n B 21)" 22test $t = AB 23or echo $t 24' 25 26run-concurrently ' 27eval " 28command echo -n C 29echo -n D 30" | read -l t 31test $t = CD 32or echo $t 33' 34 35run-concurrently ' 36# block/function node output is buffered also 37begin 38command echo -n E 39echo -n F 40end | 41read -l t 42test $t = EF 43or echo $t 44'