首页 > 系统服务 > 详细

每天学点 shell 脚本

时间:2016-06-17 15:34:05      阅读:282      评论:0      收藏:0      [点我收藏+]

---恢复内容开始---

初级阶段:

  -- 文件操作:

          -- 文件整体: 增、删、复制、移动;

          -- 文件内容: 追加、覆盖、清空;

  -- 正则表达式:

  -- 字符串:

          -- 截取,拼接;

echo " ABCD " > shellTest.log

: 将 " ABCD " 写入至 shellTest.log 中,如果shellTest.log不存在,将会首先创建 shellTest.log

echo " ABCD " >> shellTest.log

: 将 " ABCD " 追加至 shellTest.log 中,如果shellTest.log不存在,将会首先创建 shellTest.log

echo " ABCD " | tee  shellTest.log

: 将 " ABCD " 写入至 shellTest.log 中,并将 " ABCD " 打印至标准输出中(命令行窗口),如果shellTest.log不存在,将会首先创建 shellTest.log

echo " ABCD " | tee -a shellTest.log

: 将 " ABCD " 追加至 shellTest.log 中,并将 " ABCD " 打印至标准输出中(命令行窗口),如果shellTest.log不存在,将会首先创建 shellTest.log

---恢复内容结束---

每天学点 shell 脚本

原文:http://www.cnblogs.com/duchao-hit/p/5594131.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!