Syntax Error while using CMP function

Hi All,

I am getting a syntax error message while trying to compare 2 files using the compare function (LINUX)

command substitution: line 79: syntax error near unexpected token `('
command substitution: line 79: `cmp -s <(tr , \n < $COMMON_TMP/nt_per_gs.done | sort) <(tr , \n < $COMMON_TMP/nt_per_chg_indx.done | sort)'
+ file_cmp_chk=1

The return value should be 0 as both the .done file contain the same dates. (like below)

Can you pls help to fix this issue

Thanks
Freddie

What shell are you using to run your script?

Process subsitution is typically a bash thing, make sure you have #!/bin/bash at the top of your script, and that the OS supports named pipes.

Thanks Chubler for your reply.

The script is ksh (LINUX i.e #!/bin/ksh). I could see the same commands are working in one script, but not in this one. Not able to figure out the issue (Did comparison too):confused:

Thanks Much
Freddie

LINUX is a vague description of a huge range of unix-like Operating Systems.
Which Operating Systems and versions are you actully running?

Your might be because you have one system with the original ksh and another system with something later like ksh93.

Hi Methyl,

Pls find below the LINUX OS version,

Also, i tried with #!/bin/bash. It didnt work either.

I have used the same command in another LINUX script & it works fine. Tried copying the same line to this script & tried execting, but it still throws syntax error.

Any help will be really helpful.

Thanks,
Freddie

Moderator comments were removed during original forum migration.