Home > Software design >  Use sed to write in Line with Variables
Use sed to write in Line with Variables

Time:09-29

I want to write the content of a variable in a specific line. I got following code

sed -i "$line i\ $1" text.txt

How can i transfer $1 without the space?

CodePudding user response:

sed -i "$line i $1" text.txt

Just used the same code without the \ and it worked

  • Related