使用输出hello world!为例。
1、制作shell脚本,并赋予执行权限
cd ~/Desktop touch test.sh vim test.sh(输入 echo "hello world!" ) chmod 755 test.sh ./test.sh
输出:hello world!
2、制作可双击执行的脚本
只需将后缀sh改成command
cp test.sh test.command
3、双击command脚本
输出:hello world!
使用输出hello world!为例。
cd ~/Desktop touch test.sh vim test.sh(输入 echo "hello world!" ) chmod 755 test.sh ./test.sh
输出:hello world!
只需将后缀sh改成command
cp test.sh test.command
输出:hello world!