Hi,
a small change (try to find it ;-):
find . -name "*.c" |xargs perl -pi.bak -e's/^(#include[^"]+)"(.*?)"/$1<$2>/'
Ciao,
Martin
>> "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> #
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
> 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
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
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
6 matches
Mail list logo