1. echo 基本命令
-e 能识别特殊字符,如空格回车和颜色
echo -e “linux \n linux”
echo -e “\e[1;31m linux linux \e[0m” 颜色31m
2. shell 编写
#!/bin/bash
#The first shell
echo -e “\e[1;32m linux \e[0m”
#后面为注释
但是第一个#!/bin/bash 不是注释,且必须要写
3. 脚本执行
第一种方法(一般使用):
chmod 755 hello.sh
./hello.sh
第二种方法:
bash hello.sh