第一个shell脚本+执行

打开vs code编辑器,新建一个文件test_shell.sh,输入如下代码:

#!/bin/bash
echo "Hello World !"

执行方法1:

chmod +x ./test_shell.sh  #使脚本具有执行权限
./test_shell.sh  #执行脚本

这里写图片描述

执行方法2:

/bin/sh test.sh

这里写图片描述

更多参考:http://www.runoob.com/linux/linux-shell.html

猜你喜欢

转载自blog.csdn.net/u011280600/article/details/80745110
今日推荐