Quote:
Originally Posted by na5m
I'd like to hyphenate the word "gratefull" using sed so that "gratefull" becomes "grate-full".
|
It is unclear as to whether you are expecting the original file to be overwritten.
ie.
Code:
$ sysctl kern.version
kern.version=OpenBSD 4.3-current (GENERIC) #0: Wed Jun 4 12:43:45 PDT 2008
me@mymachine:/usr/src/sys/arch/i386/compile/GENERIC
$ cat file
first line gratefull
second gratefull line
third line
gratefull fourth line
$ sed 's/gratefull/grate-full/' file > file1
$ cat file1
first line grate-full
second grate-full line
third line
grate-full fourth line
$