Skip to content

Instantly share code, notes, and snippets.

@guyhughes
Created December 15, 2016 04:07
Show Gist options
  • Save guyhughes/da2ce2baeec97590bdcc90c8a825c596 to your computer and use it in GitHub Desktop.
Save guyhughes/da2ce2baeec97590bdcc90c8a825c596 to your computer and use it in GitHub Desktop.
#!/bin/sh
OPTS=''
X="+ */\n"
while [ $# -gt 0 ]; do
case "$1" in
-*)
OPTS+="$OPTS $1"
;;
*)
X+="+ **/$1\n"
;;
esac
shift
done
X+="- *\n"
printf "$X"
printf "$X" | rsync --inplace -Pvahr $OPTS cabana/ . --include-from="-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment