1、在grep中, ^标记着单词的开始, $ 标记着单词的结束。

查看一个单词是否在linux自带的词典中,脚本如下:

#bin/sh

#文件名:checkword.sh

word=$1

grep "^$1$"  /usr/share/dict/american-english -q

if [ $? -eq 0 ]; then

echo $word is a dictionary word;

else

echo $word is not a dictionary word;

fi

2、echo -e 中 -e 表明echo 会解释转义序列。

例如:  echo -e "1\nhello\n"

等于   1                      回车

hello                 回车

3、sed中的s表示替换(substitute)。

例如: comm a.txt b.txt -3 | sed 's/^\t//'

hbg@root:~/dl$ comm a.txt b.txt -3
apple
        carrot
        cookies
iron
silver
steel

hbg@root:~/dl$ comm a.txt b.txt -3 | sed 's/^\t//'
apple
carrot
cookies
iron
silver
steel

最新文章

  1. java 学习框架
  2. px 与 dp, sp换算公式?
  3. fstream使用简介
  4. python开发_++i,i += 1的区分
  5. Python之路【第十一篇续】前端初识之CSS
  6. hdu 4007 暴力or线段树 ***
  7. 通过反汇编理解函数调用机制(x86和ARM)
  8. JAVA开发--U盘EXE恢复工具
  9. 【原】Kryo序列化篇
  10. PHP操作Oracle数据库
  11. Linq101-Restriction
  12. 手把手教你用vue-cli搭建vue项目
  13. 关注Yumiot公众号,了解最新的物联网资讯
  14. web自动化上传附件 2
  15. 递归 + OS模块
  16. go 调用windows dll 的三种方法
  17. vim 初识
  18. 延时显示(类QQ头像显示)
  19. 读取properties文件的信息
  20. C# 数据上传(自用笔记)

热门文章

  1. windows server 2008系统VPN服务配置
  2. SQLServer批量更新
  3. java的三种构造器
  4. [读书笔记]xampp mysql启动失败解析(win7)
  5. noip 2016 提高组总结(不是题解)
  6. 2016 ACM/ICPC Asia Regional Qingdao Online
  7. Anton and Tree
  8. Linux软件安装管理 - CentOS
  9. C# 语言规范_版本5.0 (第12章 数组)
  10. SAP HANA 是什么?