linux echo 用法

来源:互联网 发布:officeword办公软件 编辑:程序博客网 时间:2024/05/16 17:09

简单字符串

#echo this is a testthis is a test

包含有单引号(‘)字符串

#echo let's see if this'll worklets see if thisll work#显然不是我们期望的,怎么处理,加上双引号包裹起来,如#echo "let's see if this'll work"let's see if this'll work

包含双引号(”)字符串

#echo 'he say "script is easy"。'he say "script is easy"

同一行显示一个文本字符串作为命令输出

#处理方法: 在第一行 添加 -n参数,如#echo -n the time and date:# datethe time and date are:Sun Apr 26 14:05:09 CST 2015
0 0