shell的使用

Bash shell的使用,正则表达式的使用。

Hi tom,
I think I failed my anatomy test yesterday. I
had a terrible stomach ache. I ate too many
fried green tomatoes.
Anyway, Tom, I need your help. I'd like to make
the test up tomorrow, but don't know where to
begin studying. Do you think you could help me?
After work, about 7 PM, come to my place and I'll
treat you to pizza in return for your help.
Thanks.
Your pal,
guy@phantom

 

:1,$s/\<[Tt]om\>/David\g

从文件的第一行到文件的最后一行(1,$)替换(s)单词Tom或者tom为David.g(global)标志表示这个命令对于全文有效。正则表达式元字符\<和>\分别界定单词的开始和结束。

你可能感兴趣的:(职场,休闲,shell实例)