- 创建 .sh 文件 给予权限
mkdir -p hello.sh //创建shell 脚本文件
chmod u+x hello.sh //赋予 sh脚本文件权限
ls -ll //查看文件权限(需要有 x)
- 写脚本
#!/bin/bash //一定是以这个开头
cd vue
npm run build
其实 就是把你 手打的命令 写进去即可
shell 教程 http://www.runoob.com/linux/linux-shell.html
- 执行
sh hello.sh
mkdir -p hello.sh //创建shell 脚本文件
chmod u+x hello.sh //赋予 sh脚本文件权限
ls -ll //查看文件权限(需要有 x)
#!/bin/bash //一定是以这个开头
cd vue
npm run build
其实 就是把你 手打的命令 写进去即可
shell 教程 http://www.runoob.com/linux/linux-shell.html
sh hello.sh