Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 2649  / 2 Years ago, wed, february 23, 2022, 7:21:20

What is the difference in doing



$ MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"


to doing



$ export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"


and is there any side-effect of doing either in an SSH connection?


More From » bash

 Answers
0

The 1st one sets the value to the variable. For instance you can do


echo $MAVEN_OPTS

and have it return the value but if you would issue that outside your shell you will have an empty string returned.


In comes export.


Export is an instruction to the shell. It tells the shell to make this environment variable available to other programs executed from the same shell. Without the export, they are only available within the shell itself.


If you want the variable to be permanently available ssh reads ~/.ssh/environment,ssh2 reads /etc/environment and ~/.ssh2/environment, and adds lines of the format VARNAME=value to the environment. From the ssh man page.


[#38901] Thursday, February 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionavocad

Total Points: 189
Total Questions: 101
Total Answers: 118

Location: Liechtenstein
Member since Wed, Dec 8, 2021
2 Years ago
tionavocad questions
Tue, May 23, 23, 00:07, 1 Year ago
Tue, Jan 17, 23, 20:38, 1 Year ago
Sun, Oct 10, 21, 04:50, 3 Years ago
Tue, Jun 7, 22, 08:50, 2 Years ago
;