Keep getting error "-bash: ./.profile_z2: line 52: syntax error: unexpected end of file"

BSD




Kindly Note - This is a Single User Post by Forum Member Don Cragun Regarding:
Keep getting error "-bash: ./.profile_z2: line 52: syntax error: unexpected end of file".
Please Follow The Primary Link Above to View the Full Discussion.

   
Old 06-08-2017
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 19 July 2018, 5:40 PM EDT
Location: San Jose, CA, USA
Posts: 11,408
Thanks: 651
Thanked 3,970 Times in 3,393 Posts
In addition to what Corona688 already said, the line:
Code:
.$etcpath/oraInst.loc

should probably be:
Code:
. $etcpath/oraInst.loc

and the line:
Code:
export HOST_NAME='hostname|awk -F'.' '{print $1}''

should either be:
Code:
export HOST_NAME=`hostname|awk -F'.' '{print $1}'`

to match the rest of your code (note backquotes instead of single-quotes), or:
Code:
export HOST_NAME=$(hostname|awk -F'.' '{print $1}')

to match recommended practices, or:
Code:
export HOST_NAME=${PS1#.*}

or, since you have already set the 1st part of PS1 to the output from the hostname command, much more efficiently::
Code:
export HOST_NAME=${PS1%%.*}

The Following User Says Thank You to Don Cragun For This Useful Post:
dodona (12-12-2017)