Imagine that you have to create many lines in file all with the same text except for one variable:
foo text $variable bar text
foo text $variable bar text
foo text $variable bar text
...
I was wondering if this could be made using a bash script passing it the variable as an argument:
./my_script '1'
./my_script '2'
./my_script '3'
Which would generate this:
foo text 1 bar text
foo text 2 bar text
foo text 3 bar text
Any suggestions or examples on how to do this?
See also http://tldp.org/LDP/abs/html/internalvariables.html#POSPARAMREF: