sr

1stMUD4.0/bin/sr · 241 B

From the archive 1stMUD4.0[1].tgz

Download the archive   « Back to the archive contents

#!/bin/bash

if [ -z $1 ]; then
echo Search for what?
exit
fi

if [ -z $2 ]; then
echo Replace with what?
exit
fi

for filex in *.c h/*.h
do
    ex - ${filex} <<EOF   
%s/$1/$2/g
wq!
EOF
done 
echo $1 replaced with $2 in source files.
exit

Site Stats

Snippets: 1791
Codebases: 571