查看当前的shell工具linux
echo $BASH
输出shell
表示当前是一个bash的环境。bash
编写第一个shell脚本 firsh_shell.sh工具
#!/bin/bash #FileName: first_shell.sh #Use: auto echo Hello World! #By authors: wl_it 2020.05.05 echo "Hello World!"
保存并修改执行权限 chmod u+x firsh_shell.shspa
或者不改权限 使用 /bin/bash first_shell.sh 执行code
说明:
#!/bin/bash 固定写法 表示脚本执行程序的路径blog
#FileName: first_shell.sh
#Use: auto echo Hello World!
#By authors wl_it 2020.05.05it
上面三行是注释class
echo "Hello World!" 真正的命令权限