怎样用sed在每一行的指定字符前添加内容

2025-03-22 08:55:26
推荐回答(1个)
回答1:

sed 's/-library/test &/' file 
CompileFile -type vhdl test -library LTE_ECSC_LIB

awk 'BEGIN{FS=OFS="-library"}{print $1" test ",$2}' file 
CompileFile -type vhdl  test -library LTE_ECSC_LIB