Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 1156  / 3 Years ago, fri, september 24, 2021, 1:23:29

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

More From » bash

 Answers
4

There needs to be a semicolon or line break before the fi:


if [ -f ~/.bashrc ]; then   . ~/.bashrc; fi

[#2206] Friday, September 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
velelf

Total Points: 395
Total Questions: 115
Total Answers: 107

Location: Sudan
Member since Mon, Jun 1, 2020
4 Years ago
velelf questions
Sat, Nov 6, 21, 05:08, 3 Years ago
Sun, Oct 9, 22, 07:37, 2 Years ago
Mon, Oct 10, 22, 08:55, 2 Years ago
Thu, Feb 17, 22, 00:27, 2 Years ago
;