Bash process substitution and syncing

前端 未结 3 1017
抹茶落季
抹茶落季 2020-12-09 09:24

(Possibly related to Do some programs not accept process substitution for input files?)

In some Bash unit test scripts I\'m using the following trick to log and<

3条回答
  •  情书的邮戳
    2020-12-09 10:21

    I sometimes put a guard:

    : > >(sleep 1; echo a; touch guard) \
      && while true; do
        [ -f "guard" ] && { rm guard; break; }
         sleep 0.2
      done    
    

提交回复
热议问题