bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] How do I report bugs?


From: Geoff Hull
Subject: Re: [open-cobol-list] How do I report bugs?
Date: Mon, 12 Apr 2010 20:18:04 +1200

Dave,

Things like a straight substitution in source code are dead easy. You can probably fix it using something like m4 (I haven't tried), or Perl as below.

Something like this should work:

find /source -type f -name \*.cob |
 xargs perl -ni -e 's/ INITIALISE / INITIALIZE /g; print;'

This will recurse down from the directory /source looking for simple files that end with '.cob', then replace all 'INITIALISE' strings surrounded by a single space with 'INITIALIZE' (also surrounded by spaces) inside those same files.

If you want to make a backup for each file with, for example, an extension like '.old', then change the Perl command to:

perl -ni .old -e 's/ INITIALISE / INITIALIZE /g; print;'

You can try this on a copy if you want. To copy a directory tree, this should do it:

cp -rp /source /source.test

If the files are owned by various users, do the above logged on as 'root'.

Geoff

reply via email to

[Prev in Thread] Current Thread [Next in Thread]