-
-
Save purpleidea/e7d7d8c52aa413c97d1e4142e9a9bf1f to your computer and use it in GitHub Desktop.
ifind
This file contains 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
# case insensitive find, eg: ifind <pattern>[ dir1[ dir2[ dirN...]]] | |
function ifind() { | |
pat="$1" | |
shift | |
if [ "$#" = "0" ]; then | |
set "." | |
fi | |
for d in "$@"; do | |
#find "$d" -iname "*$pat*" # normal | |
find "$d" -iname "*$pat*" 2> /dev/null # hide can't read errors | |
shift | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment