Unix/Linux Go Back    



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

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 (1 Day Ago)