Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

pattern matching alias linux

command_not_found_handle() {
  local cmd_str

  # change the argument-list array back to a string
  printf -v cmd_str '%q ' "$@"

  # process that string:
  case $cmd_str in
    "git@"*".git") eval "git clone $cmd_str" ;;
    *) echo "No alternative for command found" >&2; return 1 ;;
  esac
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pattern #matching #alias #linux
ADD COMMENT
Topic
Name
9+9 =