sed 's/-library/test &/' file CompileFile -type vhdl test -library LTE_ECSC_LIBawk 'BEGIN{FS=OFS="-library"}{print $1" test ",$2}' file CompileFile -type vhdl test -library LTE_ECSC_LIB