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 -->
  #7 (permalink)  
Old 10-13-2008
aliahsan81 aliahsan81 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 62
Not working see below


Code:


#! /bin/bash
RESOLV=/tmp/reslov.conf
exec < $RESOLV >$RESOLV.new

while read line ; do 
   echo "# $line"
done

echo search.example.com
echo nameserver xxx.xxx.xxxx.xxxx
echo nameserver yyy.yyy.yyyy.yyyy

exec >-
mv $RESOLV $RESOLV.$$.bak 
mv $RESOLV.new $RESOLV



tmp]$ ./resolv.sh2
./resolv.sh2: line 3: /tmp/reslov.conf: No such file or directory
^C