这里文本的仅仅一个特定的行是使用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://wordnetweb.princeton.edu/perl/webwn?s='$word'&sub=Search+WordNet&o2=&o0=1&o7=&o5=&o1=1&o6=&o4=&o3=&h=' \
| html2text -ascii -nobs -style compact -width 500 | grep "*"
我在键入“你好”这里是输出:
Type in your word:
hello
**** Noun ****
* S:(n)hello, hullo, hi, howdy, how-do-you-do (an expression of greeting) "every morning they exchanged polite hellos"
我只想要S之后的字符串,没有任何字符。我想删除以下内容:
**** Noun ****
* S:
自行离开这个管路 - >
(n)hello, hullo, hi, howdy, how-do-you-do (an expression of greeting) "every morning they exchanged polite hellos"
删除S :,但不包含****名词****。 – user191960 2009-10-24 05:52:40