Is there a way to diff on contents of multiple directories instead of two directories? Or diff a single directory on multiple hosts. I wrote the following bash script to diff a directory on three hosts
#!/bin/bash
if [[ -n "$(diff <(ssh user@host1 ls -r /user/test1) <(ssh user@host2 ls -r /user/test1))" || -n "$(diff <(ssh user@host2 ls -r /user/test1) <(ssh user@host3 ls -r /user/test1))" ]]; then
echo "There are differences"
fi
Is there a better way to do this?