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!
sh
and notbash
../scriptname
.<(...)
works inbash
but not insh
.