Tag Info

New answers tagged

2

What you are seeing are the functions defined in your shell, which is very similar to the variables, and also part of your environment. Actually the environment variables were listed too - they came first, and scrolled out of the screen. Try this command to be able to scroll up and down in the whole result: set | less You can also search with / and ?. ...


0

From https://help.ubuntu.com/community/EnvironmentVariables: Variable- DISPLAY Values Example: :0.0 localhost:10.0 terminal01:0.0 What it's for? This variable is used to indicate to graphical applications where to display the actual graphical user interface, the value consists of 3 parts: A host-name followed by a colon (:), a display number ...


0

You can create an ~/.ads directory. Assuming the API key is 123, open a terminal window with Ctrl+Alt+T and run these commands: mkdir ~/.ads echo '123' > ~/.ads/dev_key If you want to set an environment variable instead, you can study this tutorial.


0

If you change the JAVA_HOME and PATH variables as below you should be able to access your local installation. export JAVA_HOME=/home/port8080/jdk1.8.0_11/bin export PATH=/home/port8080/jdk1.8.1.0_11/bin:$PATH


2

/etc/environment takes a proper re-login to take effect, because it is processed by PAM at login. Further, as @przemo noted, it is not run or sourced as a script, so variables are not expanded. Put such variables in a .sh file in /etc/profile.d/: sudo tee -a /etc/profile.d/my_vars.sh <<"EOF" export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1 ...


2

/etc/environment is not a script file, you cannot use variables, for further reading I recommend https://help.ubuntu.com/community/EnvironmentVariables


0

For Unix/Linux, vim looks for $HOME/.vimrc, so the first thing that could affect this is, of course, the environment variable $HOME. Is this set on your system (it should be /home/your_user_name. There is no place that I've seen that specifies where this file should be, so the only other way I can see would be if you start with the -u option to specify a ...


0

Your JAVA_HOME setting is fine. The file /usr/lib/jvm/default-java should be a symlink pointing to the JRE and is provided by the default-jre-headless package. This package is required for a regular Java (default JRE) installation of Java in Ubuntu. Apparently you removed this symlink, removed the individual package or something like that, or, you installed ...


0

Well I think you almost got it. You can use this command to detect where your jvm is located. whereis jvm I have same setting and I believe you can point on either dir in JAVA_HOME as java-1.7.0-openjdk-amd64 is a weak link to other( see man for ln). Ah and Answer "it is not correct! Take one from pwd command."


1

An inventive use for $BASH_COMMAND Recently found this impressive use of $BASH_COMMAND in implementing a macro-like functionality. This is the core trick of the alias and replaces the use of the DEBUG trap. If you read the part in the previous post about the DEBUG trap, you’ll recognize the $BASH_COMMAND variable. In that post I said that it was set to ...


6

Now that Q3 has been answered (correctly, in my opinion: BASH_COMMAND is useful in traps and hardly anywhere else), let's give Q1 and Q2 a shot. The answer to Q1 is: the correctness of your assumption is undecidable. The truth of neither of the bullet points can be established, as they ask about unspecified behaviour. By its specification, the value of ...


9

Answering to the third question: of course it can be used meaningfully in the way at Bash manual clearly hints – in a trap, e. g.: $ trap 'echo ‘$BASH_COMMAND’ failed with error code $?' ERR $ fgfdjsa fgfdjsa: command not found ‘fgfdjsa’ failed with error code 127 $ cat /etc/fgfdjsa cat: /etc/fgfdjsa: No such file or directory ‘cat /etc/fgfdjsa’ failed with ...



Top 50 recent answers are included