redirect output console message of bash command

170 views Asked by At

I execute following command

bash -c 'comm -12 <(sort vms1.txt) <(sort vms2.txt)'

and it gives following output

sort: cannot read: vms1.txt: No such file or directory
sort: cannot read: vms2.txt: No such file or directory

how to suppress the above message? I tried stderr redirection method but didn't work

bash -c 'comm -12 <(sort vms1.txt) <(sort vms2.txt) 2>&-'

The point is to suppress error message and don't want to show on stdout.

0

There are 0 answers