Insert character into a line with sed? & variables in sed?
I don't really want to have to write to a file.
I need to insert a `0` into "0x0123453" between the x and the 2nd `0`.
This is the closest thing to help I've found:
# insert 5 blank spaces at beginning of each line (make page offset)
$ sed 's/^/ /'
But this is using [s]ubsitute rather than [i]nsert?
Also,
I've tried to delete by using the output from a variable:
$ export VARIABLE=0x012345
$ echo "0x012345 0x042315" | sed -e 'd/$VARIABLE'
-> my goal in this example would be "0x042315"
Is it possible to use an external variable like this? I need to correct the syntax somehow?
Thanks if you can help with either problem. I've found a real lack of documentation that covers insert of use of variables, the docs seem to contain many examples, all except the ones I need!
|