This is my code
my $shell_line_diff=`echo $(($(diff -U 0 ftest1.txt ftest2.txt|grep ^\+|wc -l)-$(diff -U 0 ftest1.txt ftest2.txt|grep ^\-|wc -l)))`;
print "difference in the number of lines is $shell_line_diff\n";
and the evaluated script works fine on Linux bash.
But in perl it gives me the following results:
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `echo 1010 1010 10000000 10000003 10000004 10000010(1010 1010 10000000 10000003 10000004 10000010diff -U 0 ftest1.txt ftest2.txt|grep ^+|wc -l)-1010 1010 10000000 10000003 10000004 10000010diff -U 0 ftest1.txt ftest2.txt|grep ^-|wc -l)))'
difference in the number of lines is
What did I do wrong?
(?