![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script problem | tdavenpo | Shell Programming and Scripting | 3 | 01-04-2006 04:07 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 08:12 AM |
| problem with a script | Lestat | Shell Programming and Scripting | 4 | 06-13-2005 12:30 PM |
| script problem | Bab00shka | Shell Programming and Scripting | 4 | 09-16-2002 10:21 AM |
| problem with ftp script...please help | vancouver_joe | UNIX for Advanced & Expert Users | 2 | 11-22-2001 07:47 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Problem with csh script
Hi All,
I have the following script. Code:
#!/bin/csh
#
# createDATfile.sh
#
cd /export/home/fastserv/bin
source /export/home/fastserv/bin/dbenv.sh
echo `date` >> /export/home/fastserv/bin/log.txt
echo "%INF% Starting send of current FASTSERVICE batch" >> /export/home/fastserv/bin/log.txt
sqlplus fastsrv/fastsrv << EOF
set serveroutput on
begin
create_fastsrv_file;
end;
.
/
EOF
if (-e /export/home/fastserv/bin/NORECORDS) then
echo "%INF% No records created" >> /export/home/fastserv/bin/log.txt
rm -f /export/home/fastserv/bin/NORECORDS
endif
#
# Now check do email
#
echo "%INF% Checking for error mail file" >> /export/home/fastserv/bin/log.txt
if (-e /export/home/fastserv/bin/mailFASTSRVerror.sh) then
cp /export/home/fastserv/bin/mailFASTSRVerror.sh send.sh
chmod 744 send.sh
rm -f mailFASTSRVerror.sh
source /export/home/fastserv/bin/send.sh
rm send.sh
echo "%INF% Sent error mail message - previous batch not picked up" >> /export/home/fastserv/bin/log.txt
endif
echo "%INF% Script completed" >> /export/home/fastserv/bin/log.txt
echo `date` >> /export/home/fastserv/bin/log.txt
When I run the script as follows, I get the output as below. Code:
$sh -x createFASTSRVfile.sh
+ cd /export/home/fastserv/bin
+ source /export/home/fastserv/bin/dbenv.sh
createFASTSRVfile.sh: source: not found
+ date
+ echo Wed Feb 20 17:26:36 GMT 2008
+ echo %INF% Starting send of current FASTSERVICE batch
+ sqlplus fastsrv/fastsrv
set serveroutput on
begin
create_fastsrv_file;
end;
.
/
SQL*Plus: Release 10.1.0.3.0 - Production on Wed Feb 20 17:26:36 2008
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> SQL> 2 3 4 SQL>
PL/SQL procedure successfully completed.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
createFASTSRVfile.sh: syntax error at line 38: `end of file' unexpected
Thanks, Rahul. |
|
||||
|
If I comment the following line, I am able to run the script without a syntax error
Code:
#source /export/home/fastserv/bin/dbenv.sh Code:
#! /bin/csh
#
set history=32
stty sane
setenv ORACLE_HOME /dboracle/orabase/product/10.1.0.3
setenv ORACLE_BASE /dboracle/orabase
setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/dt/lib:/usr/lib:/usr/ccs/bin:/usr/ucb:/usr/openv/netbackup/bin
setenv ORACLE_OWNER oracle
setenv ORACLE_TERM vt220
setenv ORACLE_SID MYDB
setenv ORACLE_BIN ${ORACLE_HOME}/bin
# Set up common environment
setenv PATH ${ORACLE_BIN}:${ORACLE_HOME}:/bin:/usr/sbin:/usr/bin:/bin:/usr/openwin/bin:${PATH}
alias dbenv source ~oracle/.dbenv
alias dba "sqlplus '/ as sysdba'"
thanks, Rahul. |
|
||||
|
I'm not familiar with csh but this is what I've found with Google:
Shell::Source - run programs and inherit environment changes - search.cpan.org Hope this helps. Regards |
|
||||
|
Now, I am running the script with its absolute path as follows and the following error is being encountered.
Code:
$ /export/home/fastserv/bin/createFASTSRVfile.sh
SQL*Plus: Release 10.1.0.3.0 - Production on Thu Feb 21 16:36:47 2008
Copyright (c) 1982, 2004, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory
Enter user-name: SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_identifier>] | /
Enter user-name: Enter password:
ERROR:
ORA-01005: null password given; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Anything similar to sh -x, we have in csh to debug? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|