Mac 为 shell 添加函数
2019-10-29 本文已影响0人
_凌浩雨
1. 查看 shell
cat /etc/shells
2. 修改默认 shell
chsh -s /bin/sh
3. 添加 shell 命令
- 创建
hello
文件
#!/bin/bash
echo "hello world 2019.10.29"
- 赋予可运行权限
chmod +x hello
- 运行
./hello
cat /etc/shells
chsh -s /bin/sh
hello
文件#!/bin/bash
echo "hello world 2019.10.29"
chmod +x hello
./hello