大家好,又见面了,我是你们的朋友全栈君。
echo [-ne][字符串]或 echo [--help][--version]
补充说明:echo会将输入的字符串送往标准输出。输出的字符串间以空白字符隔开, 并在最后加上换行号。
参 数:-n 不要在最后自动换行
-e 若字符串中出现以下字符,则特别加以处理,而不会将它当成一般
文字输出:
\a 发出警告声;
\b 删除前一个字符;
\c 最后不加上换行符号;
\f 换行但光标仍旧停留在原来的位置;
\n 换行且光标移至行首;
\r 光标移至行首,但不换行;
\t 插入tab;
\v 与\f相同;
\\ 插入\字符;
\nnn 插入nnn(八进制)所代表的ASCII字符;
--help 显示帮助
--version 显示版本信息 范例 : [root@localhost ~]# echo "what is your name "
what is your name
[root@localhost ~]# echo "what is your name:\c "
what is your name:\c
[root@localhost ~]# echo -e "what is your name:\c"
what is your name:[root@localhost ~]#
[root@localhost ~]# echo -n "what is your name "
what is your name [root@localhost ~]# [root@localhost ~]# echo "\"/dev/cdrom\""
"/dev/cdrom"
[root@localhost ~]# [root@localhost ~]# echo "this is a echo command test to echotes.txt">echotes.txt
[root@localhost ~]# cat echotes.txt
this is a echo command test to echotes.txt
[root@localhost ~]#
[root@localhost ~]# echo "$LOGNAME carry them out at `date` ">>echotes.txt
[root@localhost ~]# cat echotes.txt
this is a echo command test to echotes.txt
root carry them out at Mon Feb 16 13:18:14 CST 2009
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128424.html原文链接:https://javaforall.cn