23 lines
398 B
Bash
Executable File
23 lines
398 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
SRC=$1
|
|
DST=$2
|
|
echo "Comparing Tree 1: $SRC"
|
|
echo "Copmaring Tree 2: $DST"
|
|
|
|
tmp1="$(mktemp)"
|
|
tmp2="$(mktemp)"
|
|
|
|
cd "$SRC" && find . -type f -printf '%P\n' | sort > "$tmp1"
|
|
cd "$DST" && find . -type f -printf '%P\n' | sort > "$tmp2"
|
|
|
|
echo "Files in SRC but not DST:"
|
|
comm -23 "$tmp1" "$tmp2"
|
|
|
|
echo
|
|
echo "Files in DST but not SRC:"
|
|
comm -13 "$tmp1" "$tmp2"
|
|
|
|
rm -f "$tmp1" "$tmp2"
|
|
|