|
Last change
on this file since 3382 was 2326, checked in by cmv, 23 years ago |
|
csh plus intelligent et plus precis cmv 14/2/2003
|
-
Property svn:executable
set to
*
|
|
File size:
601 bytes
|
| Line | |
|---|
| 1 | #!/bin/csh
|
|---|
| 2 | # Pour remplacer une chaine de char par une autre dans les repertoires Sophya
|
|---|
| 3 | # find . -name \*.h -exec grep -l stream {} \;
|
|---|
| 4 | # find . -name \*.h -exec grep stream {} \; | grep include
|
|---|
| 5 | set ftemp = /tmp/replace_string.tmp
|
|---|
| 6 |
|
|---|
| 7 | set tobereplace = "iostream\.h"
|
|---|
| 8 | set replaceby = "iostream"
|
|---|
| 9 |
|
|---|
| 10 | foreach f ( */*.h */*.cc )
|
|---|
| 11 | grep "$tobereplace" $f > /dev/null
|
|---|
| 12 | if( $status == 0 ) then
|
|---|
| 13 | echo $f
|
|---|
| 14 | rm -f ${ftemp}; cp $f ${ftemp}
|
|---|
| 15 | # Attention on ne peut pas changer de chaine de char avec des "?" dedans
|
|---|
| 16 | cat ${ftemp} | sed "s?$tobereplace?$replaceby?g" >! $f
|
|---|
| 17 | endif
|
|---|
| 18 | end
|
|---|
| 19 |
|
|---|
| 20 | rm -f ${ftemp}
|
|---|
| 21 |
|
|---|
| 22 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.