O comando diff sai com 1
se houver diferença. A maneira fácil usa isso como uma verificação de sucesso / falha:
diff file1 file2 || print "file1 and file2 had the difference"
diff file3 file4 || print "file3 and file4 had the difference"
Eu tenho alguns comandos em um arquivo que são como
diff file1 file2
diff file3 file4
E se qualquer coisa é saída eu quero imprimir qual comando isso aconteceu, como
diff file1 file2
if (there was output from the diff command)
print "file1 and file2 had the difference"
endif
diff file3 file4
if (there was output from the diff command)
print "file3 and file4 had the difference"
endif
O comando diff sai com 1
se houver diferença. A maneira fácil usa isso como uma verificação de sucesso / falha:
diff file1 file2 || print "file1 and file2 had the difference"
diff file3 file4 || print "file3 and file4 had the difference"