[HPADM] Modification of fstab via a script

From: McIntosh Alan-R54071 (alan@motorola.com)
Date: Tue Jan 13 2004 - 13:07:43 EST


 
Script Guru's,
 
I am at a loss trying to figure out why the modification of the fstab fails from
within a script(modification section listed below), yet works fine from the
command line.
 
--------------------------------------------snip-----------------------------------------------
#!/bin/sh
#
# The bulk of the script has already been completed and this is the last section to
# be completed. The '$VG' and '$NEWVG' variables have been set previously and
# the mount command works fine.
#
if [[ `mount /dev/$NEWVG/lvol3 /mnt` -eq 0 ]] ; then
# change "vg00 ($VG)" to "vg01($NEWVG)"
ed - /mnt/etc/fstab << END
1
1,$s/${VG}/${NEWVG}/g
.
w
q
END
      umount /mnt
else
        error "Unable to mount /mnt on /dev/$NEWVG/lvol3, please modify /etc/fstab manually!!"
fi
--------------------------------------------snap----------------------------------------------
 
There is no error indicated, but the changes are not made and saved as they
are from the command line. I have never had a problem using 'ed' to modify
scripts before. What the heck is going on with this script?! Thanks in advance
for any suggestions.
 
-Alan McIntosh
 

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:38 EDT