Tag Info

Hot answers tagged

3

I think your problem is due the space in the environment variable's contents. Looking at the examples from the systemd docs, an assignment should be a single string: Example: Environment="ONE=one" 'TWO=two two' ExecStart=/bin/echo $ONE $TWO ${TWO} This will execute /bin/echo with four arguments: one, two, two, and two two. Example: ...


2

Normally, .bashrc is only sourced for interactive shells, but many linux distributions decide to build bash with a special option to also source it for non-interactive shells if a SSH_something variable is in the environment. However, it doesn't switch the shell to interactive mode when doing this, so the following case command near the top of the default ...


2

a= cut -f 1 abc.txt This doesn't work, this will assign the word 'command' cut to the variable a. The correct syntax is a=`cut -f 1 abc.txt` Now you can run the command echo $a and check the result. Works The second command cut -f 1 abc.txt >a This will redirect the output of the command cut -f 1 abc.txt into a newly created file named a ...


2

I do not understand why that is required for Tomcat. All configuratios are in eg: /etc/tomcat7/server.xml. I have worked for several years with Tomcat, but this kind of configuration I've never needed. Anyway here is your answer. TL;DR env "host.name=localhost" Test with: env "host.name=localhost" perl -le 'print $ENV{"host.name"}' or with Java: ...


2

The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles. Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present: /etc/environment ~/.profile ~/.bashrc Once removing the line from the file, log ...


1

It seems you have included the file name in the path, which is wrong. The PATH must contain the directory that in turn contains the executable you want to run, not the executable itself. Use this: export PATH=$PATH:/usr/local/zettair/bin This will work for the running session and all child processes only, you can make it permanent by adding it to your ...


1

Thanks a lot for your reply AB. However i found a much better solution. I simply added in the CATALINA_OPTS variable of tomcat in the file /usr/share/tomcat7/bin/setenv.sh: export CATALINA_OPTS="-Dhost.name=localhost" This worked exactly as I wanted.


1

Your $JAVAHOME is pointing to the correct location. But the path should have $JAVAHOME/bin directory and not $JAVAHOME itself. JAVA_HOME="/opt/jdk1.7.75" export JAVA_HOME PATH="$PATH:$JAVA_HOME/bin" You should consider using the Oracle Java PPA instead. It usually does more than what a manual installation would do. You don't have to worry about setting ...


1

/etc/profile : A global configuration script that applies to all users. ~/.bash_profile : A user's personal startup file. Can be used to extend or override settings in the global configuration script. ~/.bash_login : If ~/.bash_profile is not found, bash attempts to read this script. ~/.profile --> If neither ~/.bash_profile nor ~/.bash_login is found, ...


1

/etc/environment is where the default PATH is set. To remove a directory from that, I suppose the easiest way is to edit it directly. OTOH I think you should think twice before doing so. Otherwise, as has been mentioned in other answers, there are several possible places where you could add a directory. Also, the tutorial EnvironmentVariable provides useful ...



Only top voted, non community-wiki answers of a minimum length are eligible