Last active
August 29, 2015 14:03
-
-
Save ypetya/3e22273d8c637706b7fc to your computer and use it in GitHub Desktop.
Create a helper bash function to collect documents on my computer
This file contains hidden or 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 | |
| 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 | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source collect.sh collect