Unix/Linux Go Back    

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


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 Unix and Linux 06-09-2017   -   Original Discussion by getzeeshan
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is online now Forum Staff  
Join Date: Jul 2012
Last Activity: 13 December 2017, 8:59 PM EST
Location: San Jose, CA, USA
Posts: 10,774
Thanks: 590
Thanked 3,771 Times in 3,219 Posts
In addition to what Corona688 already said, the line:


should probably be:

. $etcpath/oraInst.loc

and the line:

export HOST_NAME='hostname|awk -F'.' '{print $1}''

should either be:

export HOST_NAME=`hostname|awk -F'.' '{print $1}'`

to match the rest of your code (note backquotes instead of single-quotes), or:

export HOST_NAME=$(hostname|awk -F'.' '{print $1}')

to match recommended practices, or:

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::

export HOST_NAME=${PS1%%.*}

The Following User Says Thank You to Don Cragun For This Useful Post:
dodona (1 Day Ago)