• We did not send an email asking for donations - please read this post.

$PATH is not set properly

longroad

New Member
Joined
Aug 26, 2021
Messages
1
Reaction score
0
Credits
17
Hi,
I am using Ubuntu 64-bit on a VM and installed an app, added it to $PATH using export PATH=$PWD/bin:$PATH in my terminal (T1). Worked fine. Then i wanted to use the command in another terminal (T2) and got an error message that the command is unknown (exactly that, no more information). I checked echo $PATH and the path was really missing, while I did the same in the other terminal (and it's child terminals) where it was in there. Then i added the the path again, in T2, opened a new terminal (T3) where the path was missing again. To resolve it, I navigated to $HOME/.profile and manually added the path, but it doesn't change anything, same as above. Exact line added to .profile: . "$HOME/solana-release/bin" (I used the scheme from the line above). I used source $HOME/.profile in the new terminal. The response is bash: .: /home/longroad/solana-release/bin: is a directory
It would be great if someone could help me with this, thanks!
 


dcbrown73

Well-Known Member
Joined
Jul 14, 2021
Messages
365
Reaction score
339
Credits
3,224
Your post is a little hard to read, but here goes.

You should never update your path on the command line. While you can do that, it will not persist and you risk corrupting your path if you error or forget something while exporting it.

You should update your path in your profile line that sets your path. Once you've updated it there. Then you run ". /path/to/profile".

If you read that above, there is a period "." then a space " ", then the path to the profile. You execute it in that fashion, not like executing a script.

Either that or logout and back in so that it automatically executes the profile.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top