All Questions
2
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 ...
19
votes
2
answers
95k
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 ...