|What kind of libraries are you asking about? I will assume binary files. Use the cmp command and check the exit code. This script tells you if the library files are identical:|
cmp -s /path/to/lib1 /path/to/lib2
if [[ $? == 0 ]]
echo "libraries are equal"
echo "libraries are NOT equal"