Skip to main content

All Questions

1 vote
2 answers
2k views

Use sed command with variables

I have tried every possible solution available on the Stack Overflow and its related websites but did not find any solution. I spent a reasonable amount of time on this issue and am finally posting ...
kskp's user avatar
  • 177
19 votes
2 answers
94k views

Passing a variable to sed [duplicate]

I cannot not use a shell variable in sed in the $NUMBER form. I have this line in my shell script: cat shared.txt sed 's/whatever1/$2 ... whatever2/' > shared2.txt The result in shared2.txt looks ...
user2013619's user avatar