echo 指令与 PHP 的 echo 指令类似,都是用于字符串的输出
https://www.runoob.com/linux/linux-shell-echo.html
echo "It is a test"
#这里的双引号完全可以省略,以下命令与上面实例效果一致:
echo It is a test
echo "\"It is a test\""
read 命令从标准输入中读取一行
#!/bin/sh
read name
echo "$name It is a test"
sh test.sh
echo -e "OK! \n" # -e 开启转义
echo "It is a test"
#!/bin/sh
echo -e "OK! \c" # -e 开启转义 \c 不换行
echo "It is a test"
echo "It is a test" > myfile
echo '$name\"'
echo `hostname`
echo 127.0.0.1 `hostname` >> /etc/hosts