摘要:
The exit code is 1 because nothing was matched by grep. EXIT STATUS The exit status is 0 if selected lines are found, and 1 if not found. If an error 阅读全文
posted @ 2019-06-26 19:08
kakaisgood
阅读(556)
评论(0)
推荐(0)
摘要:
在上面的结果中,前面有“+”号的行是shell脚本实际执行的命令,前面有“++”号的行是执行trap机制中指定的命令,其它的行则是输出信息。 shell的执行选项除了可以在启动shell时指定外,亦可在脚本中用set命令来指定。 "set -参数"表示启用某选项,"set +参数"表示关闭某选项。有 阅读全文
posted @ 2019-06-26 19:00
kakaisgood
阅读(1189)
评论(0)
推荐(0)
摘要:
文本处理时,经常要删除重复行,下面是三种方法 第一,用sort+uniq,注意,单纯uniq是不行的。sort -n test.txt | uniq 阅读全文
posted @ 2019-06-26 17:41
kakaisgood
阅读(246)
评论(0)
推荐(0)
摘要:
grep 同时满足多个关键字和满足任意关键字 ① grep -E "word1|word2|word3" file.txt 满足任意条件(word1、word2和word3之一)将匹配。 ② grep word1 file.txt | grep word2 |grep word3 必须同时满足三个条 阅读全文
posted @ 2019-06-26 16:50
kakaisgood
阅读(357)
评论(0)
推荐(0)

浙公网安备 33010602011771号