Skip to content

Instantly share code, notes, and snippets.

@ypetya
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save ypetya/3e22273d8c637706b7fc to your computer and use it in GitHub Desktop.

Select an option

Save ypetya/3e22273d8c637706b7fc to your computer and use it in GitHub Desktop.
Create a helper bash function to collect documents on my computer
#!/bin/bash
function collect() {
OLD_IFS=$IFS
IFS=$'\n'
files=( $(
find /d/DEV -type f \( -iname \*.docx -o -iname \*.mobi -o -iname \*.doc -o -iname \*.pdf \)\
-not \( -path '*/.git/*' -o -path '*/.m2/*' -o -path '*/caches/*' -o -path '*/.svn/*' \) 2>/dev/null
))
for i in ${files[*]} ; do
cp -v $i .
done
IFS=$OLD_IFS
}
@ypetya
Copy link
Copy Markdown
Author

ypetya commented Jun 26, 2014

source collect.sh
collect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment