LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-15-2012, 04:11 PM   #1
dsfreddie
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)


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

Quote:
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)


Quote:
$ cat /iis_dev_data3/wcc/cpmg/tmp/wcc_cpmg_nt_per_chg_indx.done
20120708,20120707

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

Thanks
Freddie
 
Old 08-15-2012, 04:37 PM   #2
werewolfy
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)
 
  


Reply


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 07:59 PM
unknown C++ function declaration syntax kpachopoulos Programming 1 08-29-2007 04:43 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 07:09 PM
Perl system function syntax Crashed_Again Programming 2 03-20-2004 05:00 AM
Shell function syntax error... psyklops Programming 1 09-03-2003 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:53 PM.

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