I'm having some troubles replacing a string in a file using sed.
Here is what I want : I want to replace the first match occured with 1 the second match with 2, etc... till the end of the file.
For example if the file looks like this :
Here is some text...
I want it to look like this after applying the above replacing system to string "text":
Here is some 2...
How can I do that ?