这里文本的仅仅一个特定的行是使用WordNet的用于词典查找命令行脚本: #!/bin/bash
# Command line look up using Wordnet - command line dictionary
echo "Type in your word:"
read word
/usr/bin/curl -s -A 'Mozilla/4.0' 'http://word
文件1: hello
- dictionary definitions:
hi
hello
hallo
greetings
salutations
no more hello for you
-
world
- dictionary definitions:
universe
everything
the globe
the biggest tree
planet
我看到很多关于如何使用sed,awk或gawk进行搜索和替换的示例和手册页。 但在我的情况下,我有一个正则表达式,我想运行一个文本文件来提取特定的值。我不想做搜索和替换。这是从bash调用的。让我们用一个例子: 实例的正则表达式: .*abc([0-9]+)xyz.*
例输入文件: a
b
c
abc12345xyz
a
b
c
,因为这听起来那么简单,我无法弄清楚如何调用SE