shell sed 引用文件执行多个命令

code

macname@localhost Desktop % cat content 
fox jumps over the lazy dog. 
fox jumps over the lazy dog. 
fox jumps over the lazy dog. 
fox jumps over the lazy dog.
macname@localhost Desktop % 
macname@localhost Desktop % cat script1.sed 
s/jumps/green/ 
s/fox/elephant/ 
s/dog/cat/
macname@localhost Desktop % 
macname@localhost Desktop % sed -f script1.sed content 
elephant green over the lazy cat. 
elephant green over the lazy cat. 
elephant green over the lazy cat. 
elephant green over the lazy cat.
macname@localhost Desktop % cat content 
fox jumps over the lazy dog. 
fox jumps over the lazy dog. 
fox jumps over the lazy dog. 
fox jumps over the lazy dog.
macname@localhost Desktop % 

 

 

 

 

 

 

 

 

 

posted @ 2020-11-26 22:20  anobscureretreat  阅读(253)  评论(0编辑  收藏  举报