Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 4918  / 2 Years ago, fri, february 18, 2022, 2:43:43

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??


More From » bash

 Answers
5

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.


[#9570] Saturday, February 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
;