What is the difference in doing
$ MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"
$ export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"
and is there any side-effect of doing either in an SSH connection?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The 1st one sets the value to the variable. For instance you can do
and have it return the value but if you would issue that outside your shell you will have an empty string returned.
Export is an instruction to the shell. It tells the shell to make this environment variable available to other programs. Without the export, they are only available within the shell itself.
If you want the variable to be permanently available ssh reads
~/.ssh2/environment, and adds lines of the format VARNAME=value to the environment. From the
ssh man page.
Sets a shell variable named
MAVEN_OPTS. It is probably followed by an
export MAVEN_OPTS command to make this variable available as environment variable to child programs, or a shell command that uses it like
java $MAVEN_OPTS ...
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"
Sets a environment variable named
MAVEN_OPTS. This environment variable is also available to child programs.
There are no side-effects except for that some java memory limits are adjusted for
maven (a build system iirc).