i'm new to shell scripting. I'm learning little by little. I'm more familiar with php which is working toward my disadvantage right now.
Anyway, i'm writing a shell script and i read in input with the following:
i now want to use this variable in my sed string replacement like so:
sed -i 's/replaceme/$foo' myfile.txt
What i'm getting instead is the literal substitution not what $foo actually equals. Instead i want it to be the input of the user:
Using this line (
read $foo ) . Say i type 'bar'.
Thus $foo='bar' from user input.
Hope that makes sense.