ak0053792
ak0053792

Reputation: 563

syntax error: `newline or ;' unexpected

To simplify my problem, i am running manually the below cmds on 2 different unix box :

CURR_DIR=`pwd`

. ${CURR_DIR}/cfg_Contact_Archival.cfg

On 1 environment, this is getting executed without any error. But on the other environment I am getting the below error : syntax error: `newline or ;' unexpected

Could you please let me know what could be the reason for this discrepancy ?

Thanks

Upvotes: 1

Views: 7540

Answers (1)

paxdiablo
paxdiablo

Reputation: 881323

Two possibilities spring to mind immediately. The first is to check and see that your files do not have Windows-style CR/LF line endings.

The second is to examine the contents of cfg_Contact_Archival.cfg to ensure it's actually a valid bash file (since you're trying to source it with .).

With bash (and some other shells), you can convince it to give you each command line before executing it by placing set -x at the top of the file.

Upvotes: 1

Related Questions