Permalänk
Medlem

Bash-script gurus unite!

Satt och scriptade när en massa kryptiska fel började dyka upp, slutligen upptäckte jag att följande:

#!/usr/bin/env bash for (( q = 0 ; q < 10000 ; q++ )); do while read -d '' z; do result+=("$z"); done < <(printf "%s\000\n" hej | grep -a 'hej') done

resulterar i en massa:

./test.bash: line 4: /var/tmp//sh-np-2094024698: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-1952491205: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-2936939995: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-255058020: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-1278477835: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-2828793980: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-1072554432: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-3404941615: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-2108961058: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-831022544: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-364043200: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-2647950239: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-2603990047: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-1748755991: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-2782766655: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-1933432698: Interrupted system call ./test.bash: line 4: /var/tmp//sh-np-1725309971: Interrupted system call

Problemet ligger i grep, pipear man printf till någon annan bin (som t.ex. cat) uppstår inga fel. Någon som har en clue?

Tack i förväg!

Visa signatur

qw q b