http://sed.sourceforge.net/sed1line.txt
# substitute (find and replace) "foo" with "bar" on each line
This is for a line of text in a file
This may be more useful, have a read of this forum page and use it as reference for what you want to do.
http://programming.itags.org/unix-li...ramming/82536/
This is closer to what you need, but you'l still need the bash interpretation of blocks of strings.
http://www.linuxquestions.org/questi...-files-723311/
http://www.ibm.com/developerworks/ai.../section5.html one of my favourites...
Changing file extensions, but you still need to define the ($)chars, like $1 is the first part of a line, $2 is the second, etcetera.
But you can also define the beginning of a line and the ending of a line without knowing how many parts there are to the line.
you could use a bash script, with a for loop...
Code:
for i in *.txt; { mv $i $i.doc}
would rename files *.txt to *.doc
Hope this gives you food for thought, I tried to search for a real solution, but did not find one.
Therefore I returned to the man pages and google.
Cheers Glenn
<edit> I'm a bit slow, and still learning sed grep and awk, I think the above examples look good. </edit>