Hello everyone,

I am a beginner to shell script . I had to modify the following script and i get the following errors :
sag.sh[11]: SAG: not found
mv: cannot create /sag_0609131449.txt :Permission denied


#!/bin/ksh
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/export/home/oracle/app/oracle/product/8.1.7/lib
export LD_LIBRARY_PATH
export ORACLE_HOME=/export/home/oracle/app/oracle/product/8.1.7
export STOCK=/export/home/oracle/app/oracle/product/8.1.7/bin
export ENT=/home/atw11w99/ent/uc5
#SAG =$SAG:/home/atw11w99/ent/uc5/sag
SAG =/home/atw11w99/ent/uc5/sag
export SAG
#export VOKUS=\(DESCRIPTION\=\(ADDRESS\=\(COMMUNITY\=OEN.MCHH\)\(PROTOCOL\=TCP\)\(HOST\=MACH3.MCHH.SIEMENS.DE\)\(PORT\=1565\)\)\(CONNECT_DATA\=\(SID\=OMCP\)\)\)
DATUM=`date +%y%m%d%H%M`
export VOKUS=\(DESCRIPTION\=\(ADDRESS\=\(PROTOCOL\=TCP\)\(HOST\=139.21.204.196\)\(PORT\=1523\)\)\(CONNECT_DATA\=\(SID\=OMCP9\)\)\)
cd $ENT
$STOCK/sqlplus VKS#1/#vokus02@$VOKUS @sag.sql
cd $SAG

mv $ENT/sag.lst $SAG/sag_${DATUM}.txt

thank u for any help in advange

You've deleted a couple of lines before posting. The error is on line 8, not 11. Take the space out from between SAG and the equal sign in the environment variable assignment. That should solve the permission denied problem too.

Hi,

Thank you . its working now .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.