SUMMARY: ksh script question

From: Brehl, Blake <Blake.Brehl_at_anritsu.com>
Date: Tue, 18 Mar 2008 17:46:29 -0700

Found a conditional in the ksh man pages.
 
#!/bin/ksh
LOCALDRV=/home/users/mfg/xxbusint1; export LOCALDRV
NFSDRV=/home/whlzdev/xxbusint1; export NFSDRV
 
cd $LOCALDRV

if [ -d $NFSDRV]
    then
        cd $NFSDRV
    else
        echo "failover mode, no NFS, writing locally"
fi
exec /someexecutable


Best Regards, Blake

________________________________

From: Brehl, Blake
Sent: Tuesday, March 18, 2008 4:00 PM
To: Tru64 Mailing List (tru64-unix-managers_at_ornl.gov)
Subject: ksh script question


Hello Admins,
 
trying to have a script that will write to a NFS mounted drive, but will
write to a local drive if the NFS mounted one is not available. Trying
this with a cd to the local drive 1st, then a cd to the NFS mounted one
2nd.
 
#!/bin/ksh
LOCALDRV=/home/users/mfg/xxbusint1; export LOCALDRV
NFSDRV=/home/whlzdev/xxbusint1; export NFSDRV
 
cd $LOCALDRV; sleep 1
cd $NFSDRV
 
exec /someexecutable
 
When either the Local or NFS drives aren't there, the 'cd' command
returns an error value of >0 and exits the shell script.
 
Any suggestions?
 
 
Blake Brehl
Sys Admin/DBA
Anritsu Company United States
Morgan Hill, CA
blake.brehl_at_anritsu.com
 
Received on Wed Mar 19 2008 - 00:48:31 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT