Advertisement
taikuh

DAMN-Indexer.command

May 12th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.01 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "+---------------------------------------------------------+"
  4. echo "+           Welcome to the DAMN Indexer Script            +"
  5. echo "+                       (for Macs)                        +"
  6.  
  7. echo "+---------------------------------------------------------+"
  8. echo "+               Clearing previous index ...               +"
  9.  
  10. cd "${0%/*}" #changes working directory to path of script
  11. rm DAMN-index.txt > /dev/null 2>&1
  12.  
  13. echo "+---------------------------------------------------------+"
  14. echo "+                 Rebuilding Index ...                    +"
  15.  
  16. find ../Root -type f ! -name '.DS_Store' -print0 | while IFS= read -r -d '' file; do
  17.     printf '%s\n' "$file" >> DAMN-index.txt
  18. done #http://askubuntu.com/questions/343727/filenames-with-spaces-breaking-for-loop-find-command
  19.  
  20. echo   "+---------------------------------------------------------+"
  21. echo   "+                  Indexing Complete!                     +"
  22. echo   "+---------------------------------------------------------+"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement