Create a new environment variable called PROJECT=MERCURY and make it persistent by adding the variable to the ~/.profile file

I am able to add using export but unable to add it to profile.
Tried using Hint : Use export PROJECT=MERCURY
and add the value to the .profile by running echo 'export PROJECT=MERCURY' >> /home/bob/.profile
But unable to complete it pleas help me

bob@caleston-lp10:~$ env
OLDPWD=/home/bob
VISIBLE=now
XDG_SESSION_ID=c1
USER=bob
PWD=/home/bob
HOME=/home/bobPROJECT=MERCURYMAIL=/var/mail/bobSHELL=/bin/bash
TERM=xterm
SHLVL=1
LOGNAME=bob
XDG_RUNTIME_DIR=/run/user/1000
PATH=/home/bob/.local/bin:/home/bob/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/local/bin:/home/mercury/bin:/home/local/mercury:/bin:/mercury/bin
_=/usr/bin/envbob@caleston-lp10:~$

That looks right. can you show the contents of the .profile file?

I have faced the same problem, adding sudo into the “export PROJECT=MERCURY’ >> /home/bob/.profile” helped me. Even being a file inside the users home directory :slight_smile:

Create a new environment variable called PROJECT=MERCURY and make it persistent by adding the variable to the ~/.profile file.

please anyone explains
I got this message **

bob@caleston-lp10:~$ echo ‘export PROJECT=MERCURY’ >> /home/bob/ .profile
-su: /home/bob/: Is a directory
bob@caleston-lp10:~$ sudo echo ‘export PROJECT=MERCURY’ >> /home/bob/ .profile
-su: /home/bob/: Is a directory**

There should be no space between /home/bob and .profile - so it should be /home/bob/.profile for the filename.


I’m having the same issue. Was there a resolution to the issue? If so, where can I find it?

The command to use is echo not export.