2015年8月2日

摘要: GNU版本的printf命令用来格式化输出,效果类似与C语言的printf函数。2.x以上版本的Bash内建的printf命令和e/usr/bin下的printf命令使用方法一样。例子:$printf "The number is %.2f\n" 100The number is 100.00$pr... 阅读全文
posted @ 2015-08-02 11:53 chenxiaopang 阅读(141) 评论(0) 推荐(0) 编辑
摘要: read命令用于从终端或文件中读取用户输入,它读取整行输入,如果没有指定名称,读取的行被赋值给内部变量REPLY。read命令常用选项:-a,-p,-s,-t,-n1、REPLY变量$readhello$echo $REPLYhello2、读入用户指定的变量$read answerhello$ech... 阅读全文
posted @ 2015-08-02 00:22 chenxiaopang 阅读(482) 评论(0) 推荐(0) 编辑

导航