Doesn't sh support process substitution <(…)?

前端 未结 3 2001
北荒
北荒 2020-12-07 02:55

On a Centos 6 machine, this works:

bash -c \'if grep -qP --line-buffered \".+\" <(tail -n 1000 -F catalina.out) ; then echo \"yes\"; fi\'
<
3条回答
  •  时光取名叫无心
    2020-12-07 03:23

    Also take note that if Bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well.

    If your sh is actually a link to bash, then this is what's causing that.

    Running sh --version; sh -c ': <(echo a)' should give you enough info.

提交回复
热议问题