The UNIX and Linux Forums  

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 01-03-2009
cfajohnson's Avatar
cfajohnson cfajohnson is online now Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,380
Quote:
Originally Posted by em23 View Post
here is are the changes that i made.


Code:
#!/usr/bin/ksh

if [ -e /etc/dmi/conf/ ]; then #check to see if /etc/dmi/conf exists
   mv conf conf.orig # move the file to .orig

What are you trying to move? You haven't checked whether there is a file (or directory) called conf in the current directory.
Quote:
Code:
else
   print "/etc/dmi/conf does not exist"

How do you know that /etc/dmi/conf doesn't exist? You didn't test for it; you tested for a directory of that name.

The same comments apply to the next section as well.
Quote:
Code:
fi

if [ -e /etc/snmp/conf/ ]; then # check to see if /etc/snmp/conf exists
   mv conf conf.orig # move the conf to .orig
else
   print "/etc/snmp/conf does not exist"
fi