1

I get a problem when executing this command:

sudo /usr/bin/comm -13 < (sort test.tsv) < (sort test_2.tsv)
Error: d_t.sh: line 4: syntax error near unexpected token `('
d_t.sh: line 4: `sudo /usr/bin/comm -13 < (sort test.tsv) < (sort test_2.tsv)'
tripleee
  • 175,061
  • 34
  • 275
  • 318
HamzaNig
  • 1,019
  • 1
  • 10
  • 33

4 Answers4

3

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.

John Moon
  • 924
  • 6
  • 10
  • 1
    We generally hesitate to link to the ABS because it is, ahem, variable quality. But the answer is good. – tripleee Dec 20 '17 at 06:53
  • Could I suggest that you modify the link to use a better-reputed reference? http://wiki.bash-hackers.org/syntax/expansion/proc_subst, f/e – Charles Duffy Jan 08 '18 at 19:22
2

Try using sudo:

  • sudo sort test.tsv > text1.tsv
  • sudo sort test2.tsv > text2.tsv
  • sudo comm -13 text1.tsv text2.tsv
Zoe
  • 27,060
  • 21
  • 118
  • 148
1

You can use one by one command

  • sort test.tsv > text1.tsv sort test2.tsv > text2.tsv comm -13 text1.tsv text2.tsv
0

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