《六》makefile中sed的用法
在編寫makefile的時候,有時會用到比較復雜的功能.
這個時候可以借助shell腳本實現(xiàn).
本次我們講解shell中sed的用法.

sed格式
其中腳本命令的格式
舉例:(替換test.txt中的文本,用新字符串替換其中的舊字符串)


shell中的一種應用舉例:
sed 's,\(.*\)\.o[ :]*,objs/\1.o: ,g' < $@.tmp > $@ ;
參考:
駕馭Makefile---李云
http://c.biancheng.net/view/4028.html
https://www.runoob.com/linux/linux-comm-sed.html?ivk_sa=1023231z
https://www.linuxprobe.com/sed-linux.html
標簽: