打开vs code编辑器,新建一个文件test_shell.sh,输入如下代码:
#!/bin/bash
echo "Hello World !"
执行方法1:
chmod +x ./test_shell.sh #使脚本具有执行权限
./test_shell.sh #执行脚本
执行方法2:
/bin/sh test.sh
打开vs code编辑器,新建一个文件test_shell.sh,输入如下代码:
#!/bin/bash
echo "Hello World !"
执行方法1:
chmod +x ./test_shell.sh #使脚本具有执行权限
./test_shell.sh #执行脚本
执行方法2:
/bin/sh test.sh