在makefile 含有 default 行,将libtommath.a 替换为 libtommath.a libtommath.so
sed -i '/default/s/libtommath.a/libtommath.a libtommath.so/' makefile
在makefile第49行添加 DLIBNAME=libtommath.so:
sed -i '49i DLIBNAME=libtommath.so' makefile
#
在 welcom 后插入 tail
sed -i '/welcom/a\tail' hello.txt
在 welcom 前插入 head
sed -i '/welcom/i\head' hello.txt
sed 命令
最新推荐文章于 2025-09-03 10:32:32 发布
本文介绍如何利用sed命令来修改Makefile文件中的特定内容,包括替换目标库文件名和在指定位置添加或插入文本。
957

被折叠的 条评论
为什么被折叠?



