Created
May 9, 2015 19:46
-
-
Save Amunak/36c1dc782588c160c58b to your computer and use it in GitHub Desktop.
Copies file metadata from source to destination tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
myecho=echo | |
src_path="$1" | |
dst_path="$2" | |
find "$src_path" | | |
while read src_file; do | |
dst_file="$dst_path${src_file#$src_path}" | |
$myecho chmod --reference="$src_file" "$dst_file" | |
$myecho chown --reference="$src_file" "$dst_file" | |
$myecho touch --reference="$src_file" "$dst_file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment