You are not logged in.

#1 2021-05-06 09:01:41

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

[SOLVED] Can't set path??!

I've been trying for hours and can't for the life of me set path!!!

I need to set:

PATH="$PATH":"$HOME/.pub-cache/bin"

I can do this in terminal and when the session closes the path (obviously) no longer works, I get it's because it's only for the session/terminal I'm using..

I've tried adding:

"$PATH":"$HOME/.pub-cache/bin"

to /etc/bash.bashrc (no bashrc file) but no where logical to actually put it.. so skipped that.

I've also tried various combinations in /etc/profile

append path '$HOME/.pub-cache/bin'

append path '/HOME/.pub-cache/bin'

append path '/home/.pub-cache/bin'

even tried..

# Force PATH to be environment
PATH="$PATH":"$HOME/.pub-cache/bin"
export PATH

# Force PATH to be environment
PATH="$PATH":"$HOME/.pub-cache/bin"
export PATH

I know some(maybe all) of these make no sense but desperation leads to stupidity.

Please help this noob!

Many thanks

Last edited by cloudlessdreams (2021-05-06 13:48:53)

Offline

#2 2021-05-06 09:16:49

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,680

Re: [SOLVED] Can't set path??!

Did you follow the order of the files that bash uses to initialise itself?
https://wiki.archlinux.org/title/Bash#C … tion_files

Offline

#3 2021-05-06 09:23:04

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,680

Re: [SOLVED] Can't set path??!

Try adding

PATH=$PATH:~/.pub-cache/bin

to your .bashrc

Offline

#4 2021-05-06 09:59:55

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

Re: [SOLVED] Can't set path??!

skunktrader wrote:

Did you follow the order of the files that bash uses to initialise itself?
https://wiki.archlinux.org/title/Bash#C … tion_files

Yes I have systematically gone through the docs.

/etc/bash.bashrc ... PATH=$PATH:~/.pub-cache/bin doesn't work. (nor does export PATH="$PATH:$HOME/.pub-cache/bin")

/etc/profile.d/*.sh .. shall I create a .sh file with just  PATH="$PATH:$HOME/.pub-cache/bin"

~/.bash_logout    Per-user, after exit of a login shell. (need it to be always in)

/etc/bash.bashrc    PATH=$PATH:~/.pub-cache/bin doesn't work. (nor does export PATH="$PATH:$HOME/.pub-cache/bin") see above.

Offline

#5 2021-05-06 10:00:40

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

Re: [SOLVED] Can't set path??!

skunktrader wrote:

Try adding

PATH=$PATH:~/.pub-cache/bin

to your .bashrc

I don't have a .bashrc just bash.bashrc

Offline

#6 2021-05-06 10:50:16

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,350

Re: [SOLVED] Can't set path??!

Just create it .

Simplest method to do that it is to copy /etc/bash.bashrc to ~/.bashrc .

Edit ~/.bashrc and delete most of it .
You do want to keep

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

just incase.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2021-05-06 11:29:13

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

Re: [SOLVED] Can't set path??!

Lone_Wolf wrote:

Just create it .

Simplest method to do that it is to copy /etc/bash.bashrc to ~/.bashrc .

Edit ~/.bashrc and delete most of it .
You do want to keep

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

just incase.

Created and added PATH=$PATH:~/.pub-cache/bin

still not executing!! Feel like an idiot!

Offline

#8 2021-05-06 11:36:03

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Can't set path??!

echo $SHELL

Offline

#9 2021-05-06 11:41:24

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

Re: [SOLVED] Can't set path??!

tucuxi wrote:
echo $SHELL

/bin/bash/

it's there ...

I think I know what it is.. my directory is /home/ajmal/.bashrc rather than /home/.bashrc  and I'm trying to point export PATH="$PATH":"$HOME/.pub-cache/bin"

should it not be .. export PATH="$PATH":"$HOME/ajmal/.pub-cache/bin"

Offline

#10 2021-05-06 11:59:33

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Can't set path??!

echo $HOME

Offline

#11 2021-05-06 13:45:55

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

Re: [SOLVED] Can't set path??!

tucuxi wrote:
echo $HOME

/home/ajmal~

Offline

#12 2021-05-06 13:48:36

cloudlessdreams
Member
Registered: 2021-03-24
Posts: 13

Re: [SOLVED] Can't set path??!

I got it working - maybe I had a typo in there God knows!!!!

Thanks a bunch!!

Offline

Board footer

Powered by FluxBB