Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-15-2012, 03:11 PM   #1
LQ Newbie
Registered: Jun 2012
Posts: 11

Rep: Reputation: Disabled
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)

cmp -s <(tr , \\n < $COMMON_TMP/nt_per_gs.done | sort) <(tr , \\n < $COMMON_TMP/nt_per_chg_indx.done | sort)
Syntax Error Message

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)

$ cat /iis_dev_data3/wcc/cpmg/tmp/wcc_cpmg_nt_per_chg_indx.done

$cat /iis_dev_data3/wcc/cpmg/tmp/wcc_cpmg_nt_per_gs.done
Can you pls help to fix this issue

Old 08-15-2012, 03:37 PM   #2
LQ Newbie
Registered: Dec 2007
Posts: 15

Rep: Reputation: 0
Didn't try it, just a quick shot:

Try putting a $ directly in front of both opening braces to make them an executable subcommand.

And are there really no spaces after the input redirection characters "<"?

Try additionally putting one there each (i.e. in front of the newly added "$" ), if the above does not help - the shell can be picky about whitespace.
Funny enough, you put spaces around the commas inside the brackets, which should be unncessary - but better too many than too few, if in doubt ;o)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CLI syntax for rename function? buccaneere Programming 11 10-19-2009 06:59 PM
unknown C++ function declaration syntax kpachopoulos Programming 1 08-29-2007 03:43 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
Perl system function syntax Crashed_Again Programming 2 03-20-2004 04:00 AM
Shell function syntax error... psyklops Programming 1 09-03-2003 01:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration