New AIX User- help with error 0403-057

I am completely new to UNIX and can not execute some very simple code.

I am trying to execute a ksh command and recieve an error :

"0403-057 Syntax error at line 82 : `if' is not matched."

where line 82 is:

". /home/C_files/_bash.cfg"

I did not know that calling a config file qualifies as an "if" statement"

Any ideas on what I am doing wrong?
Thanks

On the surface this looks like a syntax error. Run this script in verbose/debug mode so you can get more information and post the contents of that section near line 82.

Do set -x before running the script andp ost results. Also, try running

/home/C_files/_bash.cfg

If this runs, then the problem is probably in some if statement that encloses that line.
If it doesn't run, then the problem may be in _bash.cfg.

Note the "." at the beginning has a special meaning. It means to run the script but to preserve any environment variables.

Thanks. I added set -x to the ksh and recieve :

04:10 PM $ /home/C_files/m_code.ksh -E 2012 -D 201311 -C CR
+ /home/C_files/m_code.ksh -E 2012 -D 201311 -C CR
+ . /home/C_files/_bash.cfg
/home/C_files/m_code.ksh[83]: 0403-057 Syntax error at line 83 : `if' is not matched.

Does this look right?

When I run without the period, it seems to run- but you re saying that reading that bash.cfg statement is affecting other "if" statements?

confused :frowning:

It looks like the intention of the call the _bash.cfg is to preserve whatever it does (like vars) in the calling process/shell. What is that _bash.cfg? What happens when you run _bash.cfg and include the "." (this is called sourcing that file. Do...

.  /home/C_files/_bash.cfg

This seems like a collection of scripts being executed.

You are right. The bash.cfg is a config file for a bigger program. So we want to use the "." preceding it to save vars right?

The bash.cfg file sets directories for the other programs. I get a ton of "command not found" and "path name does not exist" errors when I run that,

fix the issues in that file...full path names should be used...looks like you are trying to get something to work in a new environment...maybe something that ran in a bash environment now in korn (ksh)