I’d like to use diff Unix command to compare between output files.
However , sometimes there is a redundant “\n” in the end of the output , but I still want to consider files as the same.
say I’ve this output:
XXXXX
XXXXX
and:
XXXXX
XXXXX\n
(cant get it to show an empty line , so i wrote \n)
I’d like to able to use unix diff command stil consider these two outputs as equal.
to make myself clear , i only want to ignore last enter (“\n”) only. the rest shouldn’t be ignored.
for example , these two outputs should not be considred equal:
XXXXX
XXXXX
and
XXXXX
XXXXX
thanks
Have you tried the
-boption:http://unixhelp.ed.ac.uk/CGI/man-cgi?diff
If you only wish to exclude the last possible new line try removing it with sed before piping the result to diff: