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)$'

posted on 2025-04-26 17:34  yusisc  阅读(27)  评论(0)    收藏  举报

导航