Re: [off-topic] Best way to replace quotes with angle brackets

1998-09-28 Thread Martin Bialasinski
Hi, a small change (try to find it ;-): find . -name "*.c" |xargs perl -pi.bak -e's/^(#include[^"]+)"(.*?)"/$1<$2>/' Ciao, Martin

Re: [off-topic] Best way to replace quotes with angle brackets

1998-09-28 Thread Martin Bialasinski
>> "OO" == Ossama Othman <[EMAIL PROTECTED]> writes: OO> Cool! However, I have several "types" of includes, e.g.: OO> #include "duh.h" OO> # include "duh.h" OO> #include /**/ "duh.h" OO> # include /**/ "duh.h" OO> # include ... etc. OO> As such, I'd like to be able to do something like: OO> #

Re: [off-topic] Best way to replace quotes with angle brackets

1998-09-28 Thread Ossama Othman
Cool! However, I have several "types" of includes, e.g.: #include "duh.h" # include "duh.h" #include /**/ "duh.h" # include /**/ "duh.h" # include ... etc. As such, I'd like to be able to do something like: #include "duh.h"-> #inclu

Re: [off-topic] Best way to replace quotes with angle brackets

1998-09-28 Thread Peter S Galbraith
> What is the best way to replace quoted includes (#include "duh.h") with > bracketed includes (#include )? $ perl -i.bak -ne 'if (/#include \"(.*)\"(.*)$/) {print "#include <$1>$2\n"} else {print $_}' *.h (Creates a .bak file for every file processed from the *.h) -- Peter Galbraith, researc

Re: [off-topic] Best way to replace quotes with angle brackets

1998-09-28 Thread Shaleh
I think that a s/^#include "(\w+\.h)"/#include <$1>/ is close to what you want. The (foo) (1) notation means find this chunk nad store it. Then it is accessed as 1. More could be used and they would be 2, 3, etc. The above regex is Perl notation. It should move to any other regex style fairly

[off-topic] Best way to replace quotes with angle brackets

1998-09-28 Thread Ossama Othman
Hi all, What is the best way to replace quoted includes (#include "duh.h") with bracketed includes (#include )? I've got over one hundred files that use quoted includes and I would like to switch them over to bracketed includes. The package I am creating/maintaining uses the quoted includes and