Originally Posted by Mangled
As far as I'v seen sed depends on a line number or a constant in the file, ie changing line 1 or changing 123 to 321.
Is it possible to change a variable if you have another constant in a line as in:
changing 'this is somenumber' to 'this is anothernumber' if you don't know what the line or variable is.
Should I be using sed or is there something better/easer?
You can USE a variable in SED (as shown by Druna). You cannot use SED to change a variable. SED operates on a stream of data (from a file or elsewhere) and makes changes on the fly. You can bring in the content of a variable (i.e. create a copy), but you can't change the original using SED.
Here is the best SED tutorial I have seen:
I suggest you post an example (excerpt) of a file that you want to process, and the kind of change you want to make.