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 % 

原文地址:https://www.cnblogs.com/sea-stream/p/14044960.html