Reputation: 53
I'm using Terminal to run a curl request to an API, and am storing the result of that request in a text file.
On a subsequent command, I am comparing a previously stored text file to the new text file where the curl request was stored.
Using a tool text comparison software (https://www.diffchecker.com) to identify any changes between the two files. It's stating that a majority of the text has been removed ----- but the text is exactly the same when I read it:O
Has this happened to anyone else? Not sure how to resolve. I can't post the filed online as they are confidential :(
Thanks for the help!
Upvotes: 2
Views: 681
Reputation: 246837
The simplest tool to compare files is cmp
if cmp --quiet file1 file2; then
echo "files are the same"
else
echo "files are different"
fi
If you're interested in "what changed?" then use diff
or comm
Upvotes: 3
Reputation: 979
Use the 'compare files' of HxD (Analaysis --> File Compare --> Compare, followed by F6 for each subsequent difference) which will highlight which byte(s) are different in a visual way, and use a hashing tool like QuickHash you can be certain whether the files are different or not, for certain.
Upvotes: 0
Reputation: 7565
There a good chance there a difference in the invisible characters. Like space and new lines. You can take an advanced editor like notepad++ and ask him to show invisible chars
Upvotes: 0