1#! /bin/sh 2 3. ${tstdir-.}/lib.sh 4. ${tstdir-.}/conf.sh 5 6umask 022 7rm -rf dir1 dir2 dir3 8# make the copy-from-here tree 9mkdir dir1 10cd dir1 11generate_tree_1 12chmod 640 foo/bar/baz/one.txt 13# make the tree we want to compare to 14mkdir ../dir2 15cd ../dir2 16genfile one.txt 17# we expect the file's original permissions (not umask) 18# when the target did not exist. 19chmod 640 one.txt 20 21mkdir ../dir3 22 23cd .. 24# call -a without -p 25$rsync -Dgorltr dir1/foo/bar/baz/one.txt dir3 26compare_trees dir2 dir3 27