echo 指令类似,用于字符串的输出
语法:echo string
【1:普通打印】
echo "this is a string !"
【2:显示转译字符】
echo "\" this is a string !"\"
【3:显示变量】
name="xiao jiang"
echo "it is $name!"
【4:显示换行】
echo -e "OK! \n" #开启转译
echo "it is a test !"
【5:显示不换行】
echo -e "OK! \c" #开启转译
echo "it is a test !"
【6:显示结果定向至文件】
echo "It is a test" > myfile
【7:显示命令执行结果】
echo `date`