Why does bash behave differently, when it is called as sh?

后端 未结 3 1990
名媛妹妹
名媛妹妹 2021-01-16 17:55

I have an ubuntu machine with default shell set to bash and both ways to the binary in $PATH:

$ which bash
/bin/bash
$ which sh
/bin/sh
$ ll /bin/sh
lrwxrwxr         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-16 18:40

    When bash is invoked as sh, it (mostly) restricts itself to features found in the POSIX standard. Process substitution is not one of those features, hence the error.

提交回复
热议问题