#Perma enviroment vars in ubuntu

36 messages · Page 1 of 1 (latest)

severe elbow
#

how do i do this? ^^

tight stirrup
#

You need to export them in a source file

#

Are you using bash? Or is it zsh?

severe elbow
#

i assume bash since i don't know what that means

tight stirrup
#

Bash and zsh are two different shells

#

They're the programs your terminal sends input to

severe elbow
#

idrk tbh, im using a contabo server and putty thats about as much as i can tell you lmao

tight stirrup
#

You should be able to do echo $SHELL to see what shell is being run

severe elbow
#

/bin/bash

tight stirrup
#

So you're using bash

severe elbow
#

yeah

tight stirrup
#

You should have a .bashrc file in your user's root directory

#

Add the environment variable exports there

severe elbow
#

how do i do that?

tight stirrup
#

It's just a shell script

#

So you set the envvars the same way you would in the terminal

severe elbow
#

i dont even know how to do that, this is my first time using linux

tight stirrup
#

export NAME="Some value"

severe elbow
#

so if i just type that its perma?

tight stirrup
#

In your bashrc it'll be available in your shell sessions

severe elbow
#

alright

#

still a bit confused tbh but i guess i will see if using export works

#

wait

#

so i have to edit .bashrc and then add the export lines in there?

tight stirrup
#

Yes

#

That'll make those environment variables available any time your user starts a bash shell session

severe elbow
#

ohhh alright

#

how do i edit the file?

#

i tried some command like gedit but it dosent work

tight stirrup
#

With a text editor

severe elbow
#

shall i open it in winscp?

tight stirrup
#

I just do vim ~/.bashrc or nano ~/.bashrc

severe elbow
#

alr

#

tysm

tight stirrup
#

You'll have to restart your shell or re-source the rc file.