当前位置: > shell编程 >

Shell脚本入门(十五) - echo

时间:2014-10-25 14:48来源:linux.it.net.cn 作者:it

在我们之前的例子中,我们经常使用echo命令将一些信息输出,这回我们来详细了解下echo这个命令

语法:(man echo)

echo -n :输出后不会自动换行

echo -e :会对一些字符做特殊处理

参考网址:http://blog.csdn.net/flowingflying/article/details/5309013

 

[java] view plaincopy在CODE上查看代码片派生到我的代码片
 
  1. /a : 发出警告铃音(ALERT or CTRL-G (bell))  
  2. /b : 退格(BACKSPACE or CTRL-H )  
  3. /c : 删除最后的字符及最后的换行(Omit final NEWLINE )  
  4. /e : 删除后面的一个字符(Escape character (same as /E) )  
  5. /E : 同上(Escape character)  
  6. /f : 换页符,在某些现实中会清屏,有些会换行(FORMFEED or CTRL-L )  
  7. /n : 换行(NEWLINE (not at end of command) or CTRL-J )  
  8. /r : 从行头开始,和换行不一样,仍在本行(RETURN (ENTER) or CTRL-M )  
  9. /t : tab键(TAB or CTRL-I )  
  10. /v : 竖直tab,和/f一样,显示不同机器有所不一样,通常会引起换行VERTICAL TAB or CTRL-K  
  11. /n : 在cygwin中使用/65,无法正确显示'A’但是下面两种方法否可以显示。ASCII character with octal (base-8) value n, where n is 1 to 3 digits  
  12. /0nnn : 用8进制的值表示一个字符,例如/0101,即65,表示字符’A’(The eight-bit character whose value is the octal (base-8) value nnn where nnn is 1 to 3 digits )  
  13. /xHH : 用16进制的值表示一个字符,例如/x41,即65,表示字符’A’The eight-bit character whose value is the hexadecimal (base-16) value HH (one or two digits)  
  14. // : 表示‘/’Single backslash  

 

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容