Bash: Syntax error: redirection unexpected

后端 未结 9 1691
终归单人心
终归单人心 2020-11-27 12:30

I do this in a script:

read direc <<< $(basename `pwd`)

and I get:

Syntax error: redirection unexpected

9条回答
  •  孤城傲影
    2020-11-27 12:42

    On my machine, if I run a script directly, the default is bash.

    If I run it with sudo, the default is sh.

    That’s why I was hitting this problem when I used sudo.

提交回复
热议问题