Skip to content

Instantly share code, notes, and snippets.

@fakechris
Created April 28, 2012 02:08
Show Gist options
  • Save fakechris/2515095 to your computer and use it in GitHub Desktop.
Save fakechris/2515095 to your computer and use it in GitHub Desktop.
merge_path.sh
#!/bin/sh
SRC_PATH=$0
DST_PATH=$1
for d in `ls $SRC_PATH`; do
echo "copying $SRC_PATH/$d -> $DST_PATH/$d"
rsync -aplx --link-dest=$SRC_PATH/$d $SRC_PATH/$d $DST_PATH/$d
echo "removing $SRC_PATH/$d"
rm -rf $SRC_PATH/$d
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment