#!/bin/bash# author: yonglong.wyl# data: 2021/06/03# 打印普通字符串echo "It is a echo test"# 上面的双引号完全可以省略,等价echo It is a echo test# 打印转义字符echo "\" It is a test \""# 打印变量,read命令从标准输入中读取一行,并把输入的每个字段的值制定给shell变量read nameecho "$name, It is a read test"# 打印换行echo -e "OK! \n" # -e 开启转义echo "It is a test"# 打印不换行echo -e "OK! \c"echo "It is a test"# 打印结果定向至文件echo "It is a write to echo_file.txt test" > echo_file.txt# 单引号:原样输出字符串,不转义 或者 取变量echo '$name\"'#反引号:打印命令执行结果echo `date`
