fantasyland
May 17th, 2009, 02:03 AM
Hi,
I am new to shell scripting and I need to edit a few files in a script as part of an automation process. I found out that its possible using sed/ed but the examples are a bit confusing to me and I dont want to risk testing it as it might break the system.
Suppose I want to add the following to the file " /etc/network/interfaces" :
auto eth1
iface eth1 inet static
How would I do it in a script using sed/ed assuming that the file was empty initially. File can be created using "touch" or using sed/ed.
Thanks
I am new to shell scripting and I need to edit a few files in a script as part of an automation process. I found out that its possible using sed/ed but the examples are a bit confusing to me and I dont want to risk testing it as it might break the system.
Suppose I want to add the following to the file " /etc/network/interfaces" :
auto eth1
iface eth1 inet static
How would I do it in a script using sed/ed assuming that the file was empty initially. File can be created using "touch" or using sed/ed.
Thanks