14
rated 0 times
[
14]
[
0]
/ answers: 1 / hits: 3206
/ 3 Years ago, wed, october 6, 2021, 10:26:20
While executing the below command directly over the terminal, its working fine:
comm -2 -3 <(sort FileOne.txt) <(sort FileTwo.txt) > myFile.txt
But while trying to execute it via .sh file, its giving error: Syntax error: "(" unexpected
Here is my code:
#!/bin/bash
##this will return the unique lines from the first file.
comm -2 -3 <(sort FileOne.txt) <(sort FileTwo.txt) > myFile.txt
I run the script like this:
sh ./myfilename.sh
Please help me to solve it.
Thanks!
More From » command-line