I want to stop sed
from adding a newline with the i
editing command:
>echo "hello" | sed 'i TEST'
TEST
hello
The result I want is:
TESThello
I want to stop sed
from adding a newline with the i
editing command:
>echo "hello" | sed 'i TEST'
TEST
hello
The result I want is:
TESThello
I think it is not possible. Do it this way instead:
sed 's/^/TEST/' file
You can try this too:
echo "hello" | sed "s/$/TEST/"
What it is doing is replacing the end of the line (/$/) with the text you want.