fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Noah Hellmantests: use command instead of absolute pathsa0d8d27f4

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