GG

g()
{
  if [[ $* == *['?''['']''*']* ]]
  then 
    (>&2 echo "Warning: ?][* are wildcards!") 
  fi
  SEARCH_STRING=$(printf "%s[ 
]*" "$@")
  find -L . -iname "*${SEARCH_STRING::-5}*"
}

G()
{
  # SEARCH_STRING=$(echo "$1" | sed 's/[]*?[]/\&/g')
  # find . -name "'"*$SEARCH_STRING*"'"
  if [[ $* == *['?''['']''*']* ]]
  then 
    (>&2 echo "Warning: ?][* are wildcards!") 
  fi
  SEARCH_STRING=$(printf "%s[ 
]*" "$@")
  find -L . -name "*${SEARCH_STRING::-5}*"
}

gg()
{
  grep -RIin --color=always -- "$*" . | cut -c1-1000
}

GG() # Case-insensitive, Wildcards disabled
{
  local SEARCH_STRING
  if [[ "$*" == "" ]]; then
    read -p "Type a search string: " SEARCH_STRING # For complex queries.
    history -s GG "'"${SEARCH_STRING//\'/\'\"\'\"\'}"'" # Append escaped command to history.
  else
    SEARCH_STRING="$*"
  fi
  grep -RFIn --color=always -- "$SEARCH_STRING" . | cut -c1-1000
}

P.S. Присылайте криптовалюту если вам нравится то, что я делаю.
Если не нравится - тоже присылайте.
LTC (Litecoin): LLN6X2uV1iuQ1e4tdmQZsf2RRwh4pxPSej

Leave a Reply

*