[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Scripting /etc/fstab changes



On 12/5/06, Gaddis, Jeremy L. <jeremy linuxwiz net> wrote:
On 12/5/06, David Tonhofer <d tonhofer m-plify com> wrote:

> Try this perl script, it's probably unelegant as hell but I found it in
> my "hacks" directory.
> No guarantees!!! Try it first manually, then set reallyWrite to 1 to
> replace your fstab.

Why a huge script when you can easily do it with a sed one-liner?

sed -i -e 's/^hostA/hostB/g' /etc/fstab

Or to rewrite /etc/fstab in place with perl at least something like

perl -p -i -e s/hostA/hostB/ /etc/fstab

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]