bash find with posix-extended regex
findx() {
if [[ $# -eq 0 ]]; then
set -- . # If no arguments, default to the current directory
fi
path="$1" # $1 is now the path
shift # Shift remaining parameters
find "$path" -regextype posix-extended "$@" # Run the find command
}
# Example usage:
# findx . -regex '.*\.(h|cpp)$'
浙公网安备 33010602011771号