“syntax error near unexpected token `('” error with process substitution

前端 未结 4 1181
长情又很酷
长情又很酷 2021-01-07 10:54

I get a problem when executing this command:

sudo /usr/bin/comm -13 < (sort test.tsv) < (sort test_2.tsv)


        
相关标签:
4条回答
  • 2021-01-07 11:14

    Proper process substitution syntax would be:

    sudo /usr/bin/comm -13 <(sort test.tsv) <(sort test_2.tsv)
    

    There is no space between the the "<" or ">" and the parentheses.

    See the bash hackers wiki page on process substitution.

    Also note that process substitution is not supported by POSIX sh.

    0 讨论(0)
  • 2021-01-07 11:27

    Try using sudo:

    • sudo sort test.tsv > text1.tsv
    • sudo sort test2.tsv > text2.tsv
    • sudo comm -13 text1.tsv text2.tsv
    0 讨论(0)
  • 2021-01-07 11:27

    You can use one by one command

    • sort test.tsv > text1.tsv sort test2.tsv > text2.tsv comm -13 text1.tsv text2.tsv
    0 讨论(0)
  • 2021-01-07 11:37

    You can try to use one by one command

    sort test.tsv > text1.tsv 
    sort test2.tsv > text2.tsv
    comm -13 text1.tsv text2.tsv
    
    0 讨论(0)
提交回复
热议问题