Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # Build an index of file names, excluding "boring" files
- set -e
- # Explore the directories passed as arguments, or the current directory if called without arguments
- if [ $# -eq 0 ]; then
- set .
- fi
- # Exclude version control bookkeeping files
- for x in .git .hg .svn CVS RCS SCCS _darcs; do
- set "$@" -name "$x" -prune -or
- done
- # Exclude backup files
- for x in FIND FIND.old '*~' '.*.swp' '.#*'; do
- set "$@" -name "$x" -or
- done
- # Default output file name if used on a terminal
- if [ -t 1 ]; then
- if [ -e FIND ]; then mv FIND FIND.old; fi
- exec >FIND
- fi
- # Go!
- find "$@" -print | sort
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement