syntax error: unexpected end of file .bash_profile
772
I added the below code to empty ~/.bash_profile file and after restarting and login via ssh to the server I get syntax error: unexpected end of file .bash_profile
NODE_ENV=production
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
As a general tip, I would recommend making code easier to read by using line breaks and indentations wherever possible. For example, you can lay out the lines as below (notice that you don't need a semicolon before fi in this case):
NODE_ENV=production
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
The if and fi line up nicely, making it easy to understand the block of statements between them.
There needs to be a semicolon or line break before the
fi
:As a general tip, I would recommend making code easier to read by using line breaks and indentations wherever possible. For example, you can lay out the lines as below (notice that you don't need a semicolon before fi in this case):
The if and fi line up nicely, making it easy to understand the block of statements between them.
HTH !