Hot answers tagged

25

What is this "export" phrase at the start? export is a command (more precisely it's a Bash builtin, i.e. it's not an executable present in PATH, it's a command that Bash has built-in in itself). Is it exporting the data to be available for Bash? export sets the environment variable on the left side of the assignment to the value on the right side ...


9

https://help.ubuntu.com/community/EnvironmentVariables will probably help you. Also man bash may be very helpful with understanding how that works (at least in Bash) Anyway - as for PATH= you're basically setting the PATH variable, adding some new paths to search through, adding at the end already / previously set paths, with $PATH (which is basically a ...


4

Here's the command so that everybody can follow along as they go through the bullet points. export PATH="~/.composer/vendor/bin:$PATH" export shell built-in (meaning there is no /bin/export ,it's a shell thing) command basically makes environment variables available to other programs called from bash ( see the linked question in Extra Reading ) and the ...


3

The fact that PATH is not sourced from ~/.profile has 2 very good reasons behind it: Only login shells source ~/.profile. So that's not expected to be sourced in a normal terminal. If you're unable to get it to work in a login shell that's because Zsh sources ~/.zprofile, not ~/.profile. The fact that the changes are lost after sourcing ~/.profile is ...


2

You should not set this yourself, if it can be helped. To change which Java version to use, see this guide. Snippet: If your system has more than one version of Java, configure which one your system uses by entering the following command in a terminal window sudo update-alternatives --config java This will present you with a selection that ...


2

It looks like you edited this code snippet: if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi which is included in ~/.profile by default. The answer which lead you to do so is confusing IMNSHO. I'd suggest that you change that code back to what it looked like before, and instead add a new line underneath it: if [ -d "$HOME/bin" ] ; then ...


2

If you're using bash as your default shell, you can indeed set PROMPT_COMMAND. You usually find hints or detailed guidelines in the manual pages of a command (online from the bash man page) or by typing man bash for example: PROMPT_COMMAND If set, the value is executed as a command prior to issuing each primary prompt. I did propose another solution ...


2

how was PROMPT_COMMAND chosen to get the job done PROMPT_COMMAND is one of the variables specific to bash, which runs its value as a command before printing your $PS1 prompt on screen. By default it's unset. How to make out setting what env. variable would get the job done By reading the man page of bash, man bash in terminal. There is list of ...


2

Read the man page of the program you are trying to influence with an environment variable. For PROMPT_COMMAND it's man bash. Since programs generally use all upper case environment variables, and environment variables are passed to programs as strings, (in the env array, along with the argv array) and accessed by name, you can generate a list including all ...


2

Maybe your $SHELL is not set or set to /bin/sh? Or you have a shell set to /bin/sh in your .screenrc file? See screen's documentation: -s program sets the default shell to the program specified, instead of the value in the environment variable $SHELL (or /bin/sh if not defined). This can also be ...


1

Actually this is a great question for Unix & Linux because it is not only related to Ubuntu. There is a really nice answer on SuperUser which describes the Difference between .bashrc, .bash_profile and .profile. The accepted answer explains this pretty well. Here are some relevant parts from that answer: Bash is a Bourne-like shell. It reads ...


1

You need to add $JAVA_HOME/bin to your PATH You can verify this easily: $ PATH=$PATH:$JAVA_HOME/bin $ java -version After you've verified it works, edit your ~/.bashrc file to include the line export PATH=$PATH:$JAVA_HOME/bin


1

I got my answer from WikiHow at the following URL http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux


1

If you mean you want to test both variables use && operator and another test until [ $x -eq 180000" ] && [ $y -eq 9999 ]; do


1

You can use two for loops i.e. one for y and one for x (or while/until in the y's loop i.e. the outer loop): #!/bin/bash for ((y=0; y<12345; y++)); do for ((x=40000; x<180000; x++)); do dd bs=1 if=static.file of=extracted${x}.file skip=12345 count=$x; first_ten=$(hexdump -e '1/1 "%.2X"' "extracted${x}.file" | head -c 10); ...


1

Login to your account and open .bash_profile file $ vi ~/.bash_profile Set JAVA_HOME as follows using syntax export JAVA_HOME=<path-to-java-bin-directory>/java If you want changes effected without logout, enter command below: $ source ~/.bash_profile


1

The export command makes variables available in subshells. That is, without it, the variable PATH would not be visible in subshells. PATH is mentioned twice: As variable the value is being assigned to, left of the = sign. As variable name being replaced by its value right of the = sign. This makes the old value be part of the new value.


1

Going through the basics, I will suggest the following steps: 1. It's recommended to set environment variables in /etc/environment 2. Open the file as superuser in an editor as it's a read only file e.g. gedit: gksu gedit /etc/environment 3. System will need password to open it in editable mode. Enter your superuser password and get file opened in a new ...



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