Changing back slashes to forward slashes

Ronald Pikkert ronald at atcmp.nl
Fri Aug 17 18:28:51 AEST 1990


>From article <1990Aug16.194644.14376 at athena.mit.edu>, by ramon at skye.mit.edu (Ramon F Herrera):
<> 
<> I have a question for those {sed, grep, awk, tr} wizards out there.
<> #include "dira\dirb\incl.h"
<> to 
<> #include "dira/dirb/incl.h"
<> 

For a real edit-job use a real editor :-)

script 
------
ed - $1 <<@
g/^#include/s/\\\/\\//g
w
@

Invoke this script as: "script prog.c" and it will do the job.
You can run it without having to worry about creating 
temporary files, wich you would need with any of the filters
you mentioned.

Have fun,

-
Ronald Pikkert                 E-mail: ronald at atcmp.nl
@ AT Computing b.v.            Tel:    080 - 566880
Toernooiveld
6525 ED  Nijmegen



More information about the Comp.unix.questions mailing list