The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: resolv.conf
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 10-13-2008
aliahsan81 aliahsan81 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 62
HI Again

I have made the script,In its initial stage,Need to ask one question i am taking backup of reslov.conf with this name reslov.conf~ but a problem is that when next time script run it will over write the backup file with new value.see my code you will get what i m saying ,Please ans this ASAP,its urgent.THX TO ALL
Code:


#!/bin/bash


sudo sed -i~ 's?^?#?' /home/syed/shellscript/resolv.conf


echo     search.example.com  >> resolv.conf

echo    nameserver xxx.xxx.x.x  >> resolv.conf

echo     nameserver xxx.xxx.x.x  >> resolv.conf

cat /home/syed/shellscript/resolv.conf