There is a line in ~/.profile
which is
PATH="$HOME/bin:$HOME/.local/bin:$PATH"i
I'm not sure about the last i
.
- Should I remove it??
- Isn't it a syntax error??
There is a line in ~/.profile
which is
PATH="$HOME/bin:$HOME/.local/bin:$PATH"i
I'm not sure about the last i
.
No, it's not a syntax error; it's just a letter which is appended after the expansion of $PATH
, because the shell removes quotes...
$ PATH="$HOME/bin:$HOME/.local/bin:$PATH"i
$ echo $PATH
/home/zanna/bin:/home/zanna/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bini
So, as well as prepending local directories, it has effectively removed the existing /snap/bin
from my PATH, and added the non-existent /snap/bini
.
You can remove the i
to repair your PATH.
To see the change, you will need to log out and back in or run source ~/.profile
in any shell you are using (or launch the shell with bash -l
), because .profile
is read by login shells only.
If you did not make this change to your .profile
yourself, you may want to restore the default file by running
mv ~/.profile{,.old}
cp /etc/skel/.profile ~/.profile
This renames the old .profile
.profile.old
(you could also delete the file if you wanted to) and replaces it with the default version for your system from /etc/skel
.