Neubyr Neubyr wrote in post #1011813:
> I am writing a script to search for a particular string in a file and
> then copy all lines starting from matching-line to another file.
> Following should make it clear again:
> * search for first occurrence of a particular string in a file
> * find it's line number
> * copy certain text in all lines or entire line, starting from above
> line number to EOF to another file

$ sed -n -e '/rx/,$ {s/foo/bar/g; p}' a_file

:-)

Kind regards

robert

-- 
Posted via http://www.ruby-forum.com/.