lundi 7 novembre 2016

How to compare two program outputs (sed and my own) in bash if-statement [duplicate]

This question already has an answer here:

I know that two if-arguments are correct and the same, but statement executes commands from else-part.

if [$(sed '1q;d' ./test0.out) = $(./myprog < ./test0.in)]; then
   echo "Test passed"
else
   $(error Test not passed)
fi

The code is inside Makefile and it cripple-simulates SPOJ tests. Why is the if-condition not fulfilled?

Aucun commentaire:

Enregistrer un commentaire