Changing back slashes to forward slashes
Randal Schwartz
merlyn at iwarp.intel.com
Fri Aug 17 07:53:18 AEST 1990
In article <1990Aug16.194644.14376 at athena.mit.edu>, ramon at skye (Ramon F Herrera) writes:
|
| I have a question for those {sed, grep, awk, tr} wizards out there.
| I'd like to change all the occurrences in a file of a line like this:
|
| #include "dira\dirb\incl.h"
|
| to
|
| #include "dira/dirb/incl.h"
|
| but only for the lines that begin with "#include".
perl -pi~ -e 's#\\#/#g if /^#include/' file1.c file2.c file3.c ...
Pretty darn simple with Perl. Even leaves you a backup.
Just another Perl hacker,
--
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/
More information about the Comp.unix.questions
mailing list