projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
45c5d72
)
added comments, removed old commented code.
author
Chris Koeritz
<fred@gruntose.com>
Wed, 7 Sep 2016 02:14:54 +0000
(22:14 -0400)
committer
Chris Koeritz
<fred@gruntose.com>
Wed, 7 Sep 2016 02:14:54 +0000
(22:14 -0400)
scripts/files/compare_dirs.sh
patch
|
blob
|
history
diff --git
a/scripts/files/compare_dirs.sh
b/scripts/files/compare_dirs.sh
index 4469b1281ea5a92ec0827846121dcbf676ebd400..ee1d69ae1aad71447707a21c7911500cb3eb3dd3 100644
(file)
--- a/
scripts/files/compare_dirs.sh
+++ b/
scripts/files/compare_dirs.sh
@@
-1,5
+1,7
@@
#!/bin/bash
#!/bin/bash
+# compares the files and directory names in two different top-level directories
+# and prints a report of the differences.
dir1="$1"; shift
dir2="$1"; shift
dir1="$1"; shift
dir2="$1"; shift
@@
-13,18
+15,20
@@
if [ ! -d "$dir1/" -o ! -d "$dir2/" ]; then
echo The directories to be compared must already exist.
exit 1
fi
echo The directories to be compared must already exist.
exit 1
fi
+if [ "$dir1" == "$dir2" ]; then
+ echo "The two directories are the exact same folder name. So that's silly."
+ exit 1
+fi
out1="$(mktemp "$TMP/compare_dirs_output.XXXXXX")"
out2="$(mktemp "$TMP/compare_dirs_output.XXXXXX")"
pushd "$dir1" &>/dev/null
out1="$(mktemp "$TMP/compare_dirs_output.XXXXXX")"
out2="$(mktemp "$TMP/compare_dirs_output.XXXXXX")"
pushd "$dir1" &>/dev/null
-#find . -type d >"$out1"
find . >"$out1"
sort "$out1" >"$out1".sort
popd &>/dev/null
pushd "$dir2" &>/dev/null
find . >"$out1"
sort "$out1" >"$out1".sort
popd &>/dev/null
pushd "$dir2" &>/dev/null
-#find . -type d >"$out2"
find . >"$out2"
sort "$out2" >"$out2".sort
popd &>/dev/null
find . >"$out2"
sort "$out2" >"$out2".sort
popd &>/dev/null