| Last change
 on this file since 3369 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 | 
      
      
| Rev | Line |  | 
|---|
| [2321] | 1 | #!/bin/csh | 
|---|
|  | 2 | # Pour remplacer une chaine de char par une autre dans les repertoires Sophya | 
|---|
| [2326] | 3 | # find . -name \*.h -exec grep -l stream {} \; | 
|---|
|  | 4 | # find . -name \*.h -exec grep stream {} \; | grep include | 
|---|
| [2321] | 5 | set ftemp = /tmp/replace_string.tmp | 
|---|
|  | 6 |  | 
|---|
| [2326] | 7 | set tobereplace = "iostream\.h" | 
|---|
|  | 8 | set replaceby = "iostream" | 
|---|
| [2321] | 9 |  | 
|---|
|  | 10 | foreach f ( */*.h */*.cc ) | 
|---|
| [2326] | 11 | grep "$tobereplace" $f > /dev/null | 
|---|
| [2321] | 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 | 
|---|
| [2326] | 16 | cat ${ftemp} | sed "s?$tobereplace?$replaceby?g" >! $f | 
|---|
| [2321] | 17 | endif | 
|---|
|  | 18 | end | 
|---|
|  | 19 |  | 
|---|
|  | 20 | rm -f ${ftemp} | 
|---|
|  | 21 |  | 
|---|
|  | 22 | exit 0 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.