![启动 ubuntu 16.04 lts 时弹出消息](https://linux22.com/image/1204328/%E5%90%AF%E5%8A%A8%20ubuntu%2016.04%20lts%20%E6%97%B6%E5%BC%B9%E5%87%BA%E6%B6%88%E6%81%AF.png)
Error found when loading /home/user/.profile
/home/user/.profile line 20: command not found
As a result the session will not be configured correctly
Fix the problem as soon as feasible
这是输出cat -n /home/user/.profile
:
1 # ~/.profile: executed by the command interpreter for login shells.
2 # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
3 # exists.
4 # see /usr/share/doc/bash/examples/startup-files for examples.
5 # the files are located in the bash-doc package.
6
7 # the default umask is set in /etc/profile; for setting the umask
8 # for ssh logins, install and configure the libpam-umask package.
9 #umask 022
10
11 # if running bash
12 if [ -n "$BASH_VERSION" ]; then
13 # include .bashrc if it exists
14 if [ -f "$HOME/.bashrc" ]; then
15 . "$HOME/.bashrc"
16 fi
17 fi
18
19 # set PATH so it includes user's private bin directories
20 if [ -d "$HOME/bin"] ; then
21 PATH="$HOME/BIN:$PATH"
22 fi
23
24 #Make JAVA_HOME first...
25 export JAVA_HOME=/home/yashkanna/.javajre/jre1.8.0_161
26 PATH="$PATH:$JAVA_HOME/bin"
我应该怎么办?
答案1
"$HOME/bin"
第 20 行的和之间缺少一个空格]
,第 21 行应该是"$HOME/bin"
。
代替
if [ -d "$HOME/bin"] ; then
PATH="$HOME/BIN:$PATH"
fi
和
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi