Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

syntax error

Shell Programming and Scripting


Tags
autosys

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-23-2005   -   Original Discussion by jsresume
jsresume's Unix or Linux Image
jsresume jsresume is offline
Registered User
 
Join Date: Dec 2005
Last Activity: 28 December 2005, 11:59 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
syntax error

I'm getting a syntax error /bin/sh[5]: Syntax error at line 5 : `(' is not expected. This error only occurs when I run the script from Autosys job scheduler. If I run it from the command line it works OK.

##### `hostname` equals cherry

if [ `hostname` != "elm" ]; then
export ORACLE_SID=DMRT
USER=dmrt
PSWD=`cat /oracle/.connect_DMRT` # I'm asssuming the error is on this line
DAT_HOME=/MMA_temp_staging
LOG_HOME=/opt/prod/DMRT/KC/CASEMIX/log
CTL_HOME=/opt/prod/DMRT/KC/CASEMIX
SQL_HOME=/opt/prod/DMRT/KC/CASEMIX
SH_HOME=/opt/prod/DMRT/KC/CASEMIX
else
export ORACLE_SID=dmrt_dv
USER=jschaffner
PSWD=dev
DAT_HOME=/opt/prod/DMRT/data
LOG_HOME=/opt/prod/DMRT/data
CTL_HOME=/opt/prod/DMRT/data
SQL_HOME=/opt/prod/DMRT/data
SH_HOME=/opt/prod/DMRT/data
fi
##
Thanks. Jeff
Sponsored Links
    #2  
Old Unix and Linux 12-23-2005   -   Original Discussion by jsresume
mahendramahendr's Unix or Linux Image
mahendramahendr mahendramahendr is offline Forum Advisor  
Registered User
 
Join Date: Dec 2005
Last Activity: 22 August 2008, 8:28 AM EDT
Location: London
Posts: 222
Thanks: 0
Thanked 1 Time in 1 Post
In autosys, along with the main job script, we can also give the profile setting file... is it the main script or profile file ? if it is the main script that you are running in autosys, could you please the is any profile file and causing any problem ??

can you also tell me when you run manually, what is your defalt shell
Sponsored Links
    #3  
Old Unix and Linux 12-23-2005   -   Original Discussion by jsresume
jsresume's Unix or Linux Image
jsresume jsresume is offline
Registered User
 
Join Date: Dec 2005
Last Activity: 28 December 2005, 11:59 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
This job has no profile environment. However, I have a similar script
that uses a profile to set the env variables, and works OK from Autosys. I will try to create a profile script and see what happens.
--
Thanks. Jeff
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected. amitsinha Shell Programming and Scripting 3 05-25-2010 03:44 AM
ERROR: ./launch_full_backup.sh[18]: Syntax error at line 28 : `else' is not expected. villenan Shell Programming and Scripting 2 08-30-2009 07:36 AM
nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error astjen AIX 9 10-03-2008 12:44 PM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 12:16 PM



All times are GMT -4. The time now is 12:40 AM.