fork download
  1. testfunc() {
  2. i=1
  3. while :; do
  4. echo "processing part $i" 1>&2
  5. if { LC_ALL=POSIX dd bs=1k count=1 2>&3 >&4; } 3>&1 | grep -qe '^0[+]0 '; then
  6. break
  7. fi
  8. i=$(( i + 1 ))
  9. done 4>&1
  10. }
  11.  
  12. echo "hello, world" | wc -c
  13. echo "hello, world" | testfunc | wc -c
Success #stdin #stdout #stderr 0s 4668KB
stdin
Standard input is empty
stdout
13
13
stderr
processing part 1
processing part 2