Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix question
Nelson Flores schrieb:
> You cannot ...i least I think you can't ... you see, sed parses each
> line independently once and only once, looking for certain patterns
> .. this is what makes it so fast... so I believe that "the last line"
> is an unknown entity to sed pattern recognizer (pun intended)
You can give line addresses in sed like in ed or vi. Something like sed -e '$! s/.*/\'&/g' should work, though the op might have to experiment with escaping the single quote he wants to add. Putting the expresion into a sed script file worked for me.
The $ address operator finds the last line the ! negates this address, so sed will parse all the lines but the last.
Regards,
uwe
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Tue Mar 09 2004 - 13:52:59 CST
![]() |
![]() |