-
-
Save stav/c3ad11db66f966107deca917643aee37 to your computer and use it in GitHub Desktop.
Find files using a shorter syntax: `f .jpg`
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 | |
if [ `expr index "$1" "\+"` = 0 ]; then | |
PATTERN="*$1*" | |
else | |
#PATTERN="$1" | |
PATTERN="${1/+/*}" | |
fi | |
if [ -n "$2" ]; then | |
TARGET="$2" | |
else | |
TARGET="." | |
fi | |
eval "find $TARGET -name '$PATTERN' 2>/dev/null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment