How 'bout
perl -n -i.bkup -e 's/e-smith/mitel/i; print;' /etc/lilo.conf
as a first guess?
Thanks,
jasonDarrell May wrote:
>
> I need to open a text file, perform a substitution on a word
> and save the file.
>
> Just as an example, lets say I want to open /etc/lilo.conf
> and change every occurance of the word 'e-smith' to 'mitel'.
> Again, just a file example.
>
> [root@e-smith lilo.conf]# cat /etc/lilo.conf
> boot=/dev/hda
> map=/boot/map
> install=/boot/boot.b
> prompt
> timeout=50
> message=/boot/e-smith.pcx
> linear
> default=esmith
>
> image=/boot/vmlinuz-2.2.16-22
> label=esmith
> read-only
> root=/dev/hda6
>
> As you can see there are three changes to be made. How may
> this be done using a perl script?
>
> Darrell