{
  "alfredsnippet" : {
    "snippet" : "# 定義函數，用來檢查指令是否存在\nfunction check_command {\n  command -v \"$1\" >\/dev\/null 2>&1 || {\n    echo >&2 \"I require $1 but it's not installed. Aborting.\";\n    return 1;\n  }\n}\n\ncheck_command ls\nif [ $? -eq 0 ]; then\n  # do something\nelse\n  # do something else\nfi\n",
    "uid" : "367C4E60-A598-4730-A496-F29B23928187",
    "name" : "check_if_command_exists",
    "keyword" : ""
  }
}