📜  模式匹配别名 linux - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:41.258000             🧑  作者: Mango

代码示例1
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
}