substituting strings in source trees? 
Author Message
 substituting strings in source trees?

Is there anything about that one can use to take a source tree
(forget that) just the file since I can qualify which files to do. and
automatically do string substitutions..

One that preferably is reliable and creates backup files for every
file it touches?

I guess I could hack one of these together but I figure it's already
been done.
--
                        "Mariella Mariella Mariella"
              (PGP key: send email with Subject: request pgp key)
                       (ASCII for text only messages)



Thu, 06 Feb 1997 01:11:47 GMT  
 substituting strings in source trees?

Quote:

>Is there anything about that one can use to take a source tree
>(forget that) just the file since I can qualify which files to do. and
>automatically do string substitutions..

>One that preferably is reliable and creates backup files for every
>file it touches?

>I guess I could hack one of these together but I figure it's already
>been done.

Perl can do 'in place' editing using the -i flag, so you'd want to do
something like:

perl -pi.bak -e 's/foo/bar/g' <list of filenames>

this will leave files with backups with extensions of .bak

Hope this helps,

Mike

--
The "usual disclaimers" apply.    | Meiko
Mike Stok                         | 130C Baker Ave. Ext

Meiko tel: (508) 371 0088 x124    |



Fri, 07 Feb 1997 00:08:56 GMT  
 substituting strings in source trees?

.
.
.

Quote:
>automatically do string substitutions..

>One that preferably is reliable and creates backup files for every
>file it touches?

p. 253, Camel book:

perl -pi.bak -e 's/OLDSTRING/NEWSTRING/g' FILELIST


Bristol-Myers Squibb Pharmaceutical Research Institute
                  Princeton, NJ



Fri, 07 Feb 1997 06:38:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. split and substitute, substitute, substitute

2. Substituting source urls with redirected urls

3. perl/qt or perl/tk : graphical node tree source

4. Replication of source tree

5. Substituting many strings in one pass over the input

6. Substituting many sparsely distrbuted strings in many files

7. Pattern Match - substitute a string after the match

8. Repeat string matching/substituting ?

9. substituting string of text

10. substitute a string in array

11. how to substitute letters within a string

12. Substitute _last_ occurrece in string?

 

 
Powered by phpBB® Forum Software