Skip to content

Instantly share code, notes, and snippets.

@hrix
Forked from yuya-takeyama/statdiff.sh
Last active August 29, 2015 14:03
Show Gist options
  • Save hrix/3f0056793ffde6faaa29 to your computer and use it in GitHub Desktop.
Save hrix/3f0056793ffde6faaa29 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# 2 つのディレクトリ中のパーミッション, 所有者を一覧化し,
# お互いに差分が無いか出力する.
#
# Author: Yuya Takeyama
if [ "$1" = "" -o "$2" = "" ]; then
echo "Usage: `basename $0` file1 file2"
exit 1
fi
orig_dir=`pwd`
cd $1
find . | grep -v .svn | sort | xargs stat -c %n:%a:%U:%G > $orig_dir/statdiff.1
cd $orig_dir
cd $2
find . | grep -v .svn | sort | xargs stat -c %n:%a:%U:%G > $orig_dir/statdiff.2
cd $orig_dir
diff -ubBw statdiff.1 statdiff.2
rm -f statdiff.1 statdiff.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment