127-ssh 中文文档教程
127 SSH
捕获您的命令未发现错误并尝试 ssh。
Installation
要使用 127-ssh,您需要使用 zsh(或者可能不需要,但您需要类似于 zsh 的 TRAPZERR()
挂钩的东西)和 node.js。
首先使用 npm 安装软件包:
npm install -g 127-ssh
然后在 ~/.zshrc
中添加:
command_not_found_handler () {
printf "Command not found: $1"
127-ssh $1
return 127
}
要使 127-ssh 正常工作,您需要使用保存在 ~/.ssh/ 中的 ssh 配置文件config
并使用它来存储您的 ssh 主机。
Usage
每当您在提示符中键入某些内容作为未找到的命令退出时,该脚本将起作用。 它会尝试查找具有与您键入的命令相对应的 Host
的 ssh 配置。
LICENSE
麻省理工学院
127 SSH
Capture your command not found errors and tries to ssh.
Installation
To use 127-ssh you need to use zsh (or maybe not, but you'll need something similar to zsh's TRAPZERR()
hook) and node.
Start by installing the package with npm:
npm install -g 127-ssh
Then in your ~/.zshrc
add this:
command_not_found_handler () {
printf "Command not found: $1"
127-ssh $1
return 127
}
For 127-ssh to work, you need to use an ssh config file kept in ~/.ssh/config
and use it to store your ssh hosts.
Usage
Whenever you type something in your prompt that exit as a command not found, the script will work. It tries to find an ssh configuration with a Host
corresponding to the command you typed.
LICENSE
MIT