假设你有一个脚本名为 doSomething.sh 接收一个参数
想要运行它需要
$ cd /your/script/enclosing/folder
$ ./doSomething.sh arg 或 $ source doSomething.sh arg 或 $ . doSomething.sh arg
运行该脚本后
只需
$ doSomething arg
即可。
GitHub https://github.com/hijerusalem/custom-builtin-commands
在 macOS 下可以运行,不知道在 Linux 下能不能运行。如果觉得不错欢迎 star ,有 bug 欢迎 issue