Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> newbie unix question

newbie unix question

From: sonia pajerowski <spajerowski_at_yahoo.com>
Date: Wed, 8 Nov 2000 07:38:26 -0800 (PST)
Message-Id: <10674.121422@fatcity.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US