From 74ebc7e74c1be65b4b5ad8636009775539c0f44f Mon Sep 17 00:00:00 2001 From: Avril Date: Sat, 21 Nov 2020 17:51:31 +0000 Subject: [PATCH] added readme --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8da3345 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# fcmp - compare file identity + +A shell utils that compares files for identity with `mmap()` and `memcmp()`. + +# Usage +`fcmp` produces no output, but success is indicated by its return code. + +```shell +$ fcmp file1 file2 && echo "Equal!" +``` + +| Code | Meaning | +|------|--------------------------------------------------------------| +| 0 | The files are equal | +| 1 | The files are unequal | +| 2 | The files have unequal lengths, and therefor must be unequal | +| -1 | There was an error | + +Therefor you can use this in shell scripts easily: + +``` shell +# Example + +if fcmp "$1" "$2"; then + echo "Files are equal!" +else + echo "Files are not equal!" +fi +``` + +# License +GPL'd with <3