Operating System - HP-UX
1828621 Members
1631 Online
109983 Solutions
New Discussion

Re: error in .profile file

 
SOLVED
Go to solution
Adrian Sobers2
Super Advisor

error in .profile file

When I log into my UNIX box, I get this message now:

SIDs on this machine are IRDS IRDS8 IRDS90 IRDS9 *
.profile[70]: Syntax error: `then' is not matched.

Which .profile file is this referring to, the oracle or the one in /etc?

I just installed a patch to move from 9.2.0.6 to 9.2.0.7. Could that have touched my .profile files?
9 REPLIES 9
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: error in .profile file

Note the "." in .profile. That clearly refer's to a user's .profile. I suspect what happened was that a file that was sourced in the user's .profile contains an error.

Something like this within the .profile:

umask 027
PATH=${PATH}:./
...
...
...
. /usr/local/bin/oraenv.sh
...
...

Note the "." before /usr/local/bin/oraenv.sh; this tells the shell to include the file just as if it were part of .profile. It does not execute as a child process. You should also note that sourced files may in turn source other files.

If it ain't broke, I can fix that.
John Kittel
Trusted Contributor

Re: error in .profile file

Do you even have an /etc/.profile ?

Usually not. It is /etc/profile ( no dot)

Probably in oracle's home directory.

- Jihn
Sandman!
Honored Contributor

Re: error in .profile file

IMHO...you should test your $HOME/.profile like any other shell script i.e. put set -x at the top of the .profile or execute it at the command line manually in order to isolate the error and debug it:

# sh -x <.profile>

cheers!
Adrian Sobers2
Super Advisor

Re: error in .profile file

A. Clay Stephenson,

I checked the .profile for the user and here is that section you made reference to,

umask 022
SIDLIST=`awk -F: '/^[^#]/{printf "%s ",$1}' /etc/oratab`
echo "SIDs on this machine are $SIDLIST"
ORAENV_ASK=
. /usr/local/bin/oraenv


is the problem therefore in the /etc/oratab file?

or the /usr/local/bin/oraenv file?

Yes, I'm a newbie ;)
Adrian Sobers2
Super Advisor

Re: error in .profile file

Sandman,

When I run your command I get this:

+ eval export TERM; TERM=xterm;
+ export TERM
+ TERM=xterm
+ stty erase ^H kill ^U intr ^C eof ^D
+ stty hupcl ixon ixoff
+ tabs
+ PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/opt/resmon/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/gnome/bin:/opt/mx/bin:/usr/sbin/diag/contrib:/opt/wbem/bin:/opt/wbem/sbin:/opt/ignite/bin:.:/automate2:.:/opt/oracle/app/oracle/product/8.1.7/bin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/bin:/opt/java1.4/bin:/usr/sbin:.:/automate2
+ set -u
+ trap echo 'logout' 0
+ EDITOR=vi
+ export EDITOR
+ TZ=CST6CDT
+ export TZ
+ ORACLE_BASE=/opt/oracle
+ export ORACLE_BASE
+ ORACLE_HOME=/opt/oracle/app/oracle/product/8.1.7
+ export ORACLE_HOME
+ ORACLE_SID=IRDS
+ export ORACLE_SID
+ ORACLE_TERM=hp
+ export ORACLE_TERM
+ ORA_NLS33=/opt/oracle/app/oracle/product/8.1.7/ocommon/nls/admin/data
+ export ORA_NLS33
+ PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/opt/resmon/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/gnome/bin:/opt/mx/bin:/usr/sbin/diag/contrib:/opt/wbem/bin:/opt/wbem/sbin:/opt/ignite/bin:.:/automate2:.:/opt/oracle/app/oracle/product/8.1.7/bin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/bin:/opt/java1.4/bin:/usr/sbin:.:/automate2:.:/opt/oracle/app/oracle/product/8.1.7/bin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/bin:/opt/java1.4/bin:/usr/sbin
+ export PATH
+ TNS_ADMIN=/opt/oracle/app/oracle/product/8.1.7/network/admin
+ export TNS_ADMIN
+ BACKUP=/opt/oracle/data/orabackup
+ export BACKUP
+ GRAPH=/var/adm/backupfiles
+ export GRAPH
+ INIT_ORA=/opt/oracle/app/oracle/product/8.1.7/dbs
+ export INIT_ORA
+ ARCH_LOG=/opt/oracle/archive_logs/IRDS/arch
+ export ARCH_LOG
+ ORACLE_BASE=/opt/oracle
+ export ORACLE_BASE
+ ALERT_LOG=/opt/oracle/admin/IRDS/bdump
+ export ALERT_LOG
+ SHLIB_PATH=/opt/oracle/app/oracle/product/8.1.7/lib:/usr/lib
+ export SHLIB_PATH
+ SRCHOME=
+ export SRCHOME
+ ORAENV=/usr/local/bin
+ export ORAENV
+ TMPDIR=/tmp
+ export TMPDIR
+ umask 022
+ + awk -F: /^[^#]/{printf "%s ",$1} /etc/oratab
SIDLIST=IRDS IRDS8 IRDS90 IRDS9
+ echo SIDs on this machine are IRDS IRDS8 IRDS90 IRDS9
SIDs on this machine are IRDS IRDS8 IRDS90 IRDS9
+ ORAENV_ASK=
+ . /usr/local/bin/oraenv
.profile[70]: Syntax error at line 70 : `then' is not matched.
+ IRDS_log=/opt/oracle/admin/IRDS/bdump
+ export IRDS_log
+ echo logout
logout
Victor BERRIDGE
Honored Contributor

Re: error in .profile file

Hi Adrian,
Im quite sure you will have to look in /usr/local/bin/oraenv
For this file is executed with .~oraenv
In this file I suppose are set all the environment variable for oracle...

All the best
Victor
Adrian Sobers2
Super Advisor

Re: error in .profile file

the error must be in this file, but i need help in pinpointing it

the file attached is the oraenv file from

/usr/local/bin
Zigor Buruaga
Esteemed Contributor

Re: error in .profile file

Hi,

I think that adding a "fi" to the last line on the file will help here.

Regards,
Zigor
Adrian Sobers2
Super Advisor

Re: error in .profile file

Thank you all for your help.

Zigor Buruaga you were right, a missing "fi" at the end was the problem