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). (If I'm wrong please correct me - it's been a while :S) I would recommend editing it with VI (as shown below) or using AWK or Perl. Or .. you could always apply quotes to all the lines, and then edit out the last one :P In VI :%s/^/\'/g ]]x HTH -----Original Message----- From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of manoj.gurnani@xxxxxxxxxxxxx Sent: Sunday, March 07, 2004 11:28 PM To: oracle-l@xxxxxxxxxxxxx Subject: Unix question Importance: High Hi, I want to put a single quote before each line except last line Using sed filter . I want this in a single expression. How can I achieve the desired o/p. Thanks Manoj ---------------------------------------------------------------- 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 -----------------------------------------------------------------