Re: Unix question

  • From: Uwe Weber <uwe.weber@xxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Tue, 9 Mar 2004 20:50:16 +0100

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
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: