I have test.txt file and I want to add my variable to specific line after the word. But my sed command not work how can I do this?
test.txt file is:
Hello:
Green:
Yellow:
My variable is
echo $variable
http://111.111.111.11
My bash command is:
sed '/Green:/r/dev/stdin' test.txt <<<"$variable"
My output after run the bash command:
Hello:
Green:
http://111.111.111.11
Yellow:
My desire output:
Hello:
Green:http://111.111.111.11
Yellow: