View Single Post
  #32 (permalink)  
Old 07-24-2006, 09:45 PM
Aaron Gray
Guest
 
Posts: n/a
Default Re: sed expression to strip comments


"Dr.Ruud" <rvtol+news@isolution.nl> wrote in message
news:ea37jn.1bg.1@news.isolution.nl...
> Aaron Gray schreef:
>> I got an answer from the sed mailing list :-

>
> I know, I'm one of the moderators.


Ah !

>> sed -e '
>> \://:{
>> /\n/D;d
>> }
>> /^$/{
>> $q;N
>> /\n$/D
>> }
>> P;D
>> ' yourjavafile.js
>>
>> works okay in a command file, but not on the command line, I could not
>> separate the individual commands and give them -e's.

>
> Why not just put the commands in a cleanup.sed?
>
> C:\> sed -i~ -f cleanup.sed myfile.js


Whats the -i~ for ?

> #!/usr/bin/sed -i~ -f
> # cleanup.sed
> \://:{
> /\n/D;d
> }
> /^$/{
> $q;N
> /\n$/D
> }
> P;D
> #EOF


Yes I have a condense.sed file.

> And if you know how to make .sed executable on Windows, you might be
> able to do
>
> C:\> cleanup.sed myfile.js


There is no real point, and anyway that would have to be done by all users.

I think thats about all. Many thanks for your help.

Aaron


Reply With Quote