home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
unix
/
volume12
/
cake
/
part09
/
Script
/
gres
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1987-10-15
|
338 b
|
20 lines
#! /bin/sh
# gres - substitute regular expressions
# usage: gres from to file ...
case $# in
0|1|2) echo 1>&2 Usage: gres from to file ...; exit 1;;
esac
TERMCAP=/etc/termcap; export TERMCAP
from=$1
to=$2
shift; shift
for file in $*
do
ex - $file << END ; : use ex so that \< \> can be used
g/${from}/s/${from}/${to}/g
w
q
END
done