Building on the other answers here, some commands that parallel export but for other categories of variables are set (which works for e.g. VARIABLE=value then set | grep VARIABLE) and env
Each of these three commands, when given no arguments, prints a list of variables; which variables they will print has to do with the kinds of variables the command manages....
echo and export are very different commands in the first place.
echo will display text. In echo $JAVA_HOME, the shell will substitute $JAVA_HOME with the contents of the shell variable JAVA_HOME it it is defined. Otherwise, $JAVA_HOME will return an empty string.
export provides the "export" attribute to the shell variable. export JAVA_HOME will ...
The issue here is not really the difference between echo and export, but rather the difference between an environment variable and a simple shell variable (and also about how the /etc/environment file is normally used).
In particular, although /etc/environment happens to contain lines of the form name=value that are valid as POSIX shell variable assignments, ...
echo is a command for printing text and variables to stdout (or redirect).
export lists the current exported variables in the shell.
This thread explains why you would use export much better than I can:
https://stackoverflow.com/questions/7411455/what-does-export-do-in-shell-programming ... it does a great job explaining what export is fo
Before setting a PATH variable, you need to understand why you are setting the PATH variable. The Path variable is where the system tries to search when you issue some command in your terminal.
Example: whereis ls command shows ls is there inside /bin.
The ls command only works if /bin is registered in the path variable.
echo $PATH gives the currently ...
In LXQt, a good place to set environment variables for programs you will launch from the menu is in the session settings; these are located in the INI-style file ~/.config/lxqt/session.conf, in the [Environment] section. You can also configure them in the GUI under Preferences -> LXQt Settings -> Session Settings, where you will find the list in the ...
There are a few comments worth noting.
"... the gpg passphrase (which is set by a script)". I take it you didn't write the script. Please post the script. Are there any instructions to use it?
passphrase="my!pass". This doesn't mean "use ! as part of the string". !pass means "read history, and get the last command starting ...
Scripts that are executed for a login shell (systemwide /etc/profile, any script in /etc/profile.d, your local ~/.profile and the other files you list) define the environment of your current user - since you logged in.
Any non-login shell that you subsequently open, will at least inherit the environment of your login shell. That is why you (already) have ...
The output of the following commands should convince you that you can modify your environment variables.
$ grep PATH ~/.profile
# set PATH so it includes user's private bin if it exists
$ ls -l ~/.profile
-rw-r--r-- 1 sudodus sudodus 632 dec 10 2010 /home/sudodus/.profile
In other words,...
Every *.desktop file has Exec= field. This field may include:
executable name which is already in $PATH;
full path to executable which is not in $PATH;
full path to user/system-created script which does what is needed.
Documentation to read: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables .
You need to put double quotes around $PROJECTPATH in your alias definition.
Also, I recommend against backslashes in your variable definition. It's less readable and isn't needed in this case:
PROJECTPATH='/mnt/c/Users/name/Dropbox/My PC (Laptop...)/Desktop/Studies/Python'
alias prjct='cd "$PROJECTPATH"'
I have tried a lot of ways of setting environment but the export only seems to work and to run a bunch exports everytime it reboots you run a shell script in a cron job.
Adding systemd Environment Variable https://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile= this shows how it is done in the environment file which can only be ...
The canonical location seems to vary across distributions. With Debian 10, the system-default PATH is defined in /etc/login.defs. The default PATH for normal users is its ENV_PATH variable and the default for super-users is ENV_SUPATH. These will be used for sessions that don't spawn shells (e.g. cron jobs)
Other defaults may be defined by the per-shell ...