Alright! This is my solution.
#!/bin/ksh
if [ $# -ne 2 ];
then
echo "Error - Incorrect number of parameters passed"
exit 2
fi
NEWWIGSID=EBUC
OLDWIGSID=CRP3
OLDWIGVAR=$1
NEWWIGVAR=$2
OLDWIGDIR='/export/home/oracle/scripts/'
NEWWIGDIR='/export/home/oracle/scripts/'
USRID=system
opassword=manager
cd $OLDWIGDIR
for file in `ls -l | grep $OLDWIGVAR`
do
if [ -f $file ];
then
NEWNAME=`echo $file | sed -e
"s/$OLDWIGVAR/$NEWWIGVAR/"`
cp $OLDWIGDIR/$file $NEWWIGDIR/$NEWNAME
echo "Delete from Messages where msgname =
$file;">>delete.sql
echo "Insert into
Messages(msgname,msgstatus)values($NEWNAME,0);"
>>insert.sql
fi
done
echo "EXIT" >> insert.sql
echo "EXIT" >> delete.sql
sqlplus -s $USRID/$opassword@$NEWWIGSID @insert.sql
sqlplus -s $USRID/$opassword@$OLDWIGSID @delete.sql
rm insert.sql
rm delete.sql
rm $OLDWIGDIR/$OLDWIGVAR*
Thanks to everyone who replied. This list is great.
Sonia P.
Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one Place.
Received on Wed Nov 08 2000 - 09:38:26 CST