1
vote
2answers
39 views

Changing environment variables

I just changed my /etc/environment file to: M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1 M2=$M2_HOME/bin ...
2
votes
0answers
31 views

Echo difference between Ubuntu and Red Hat [migrated]

I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying env variables. In Ubuntu I might have ...
17
votes
3answers
253 views

What is the $BASH_COMMAND variable good for?

According to the Bash manual, the environment variable BASH_COMMAND contains The command currently being executed or about to be executed, unless the shell is executing a command as the result of ...
0
votes
1answer
21 views

variable.sh is not exporting the variable using terminal

I want to export many paths using a .sh script. after running it nothing is exported I don't know why. so if anyone can advise. This is the script used: #!/bin/bash txtrst=$(tput sgr0) # Text reset ...
3
votes
2answers
226 views

Why I obtain this error when I try to perform this simple bash script?

I am following this tutorial to correctly execute Aptana Studio on my Ubuntu 14.04: Command menu in aptana studio 3 is not working in ubuntu 14.04 So I have installed the Oracle JRE and finnally I ...
9
votes
5answers
849 views

How can I make it so I can run a specific program, just by typing its name in the console?

I have just recently installed Light Table downloading it from the git repository, and followed the instructions on this website to create a desktop launcher. Now I want to run the program by ...
1
vote
2answers
36 views

Echos, variables, and help with this question

The book Learning The Bash Shell says- "Notice that we used double quotes around variables (and strings containing them) in these echo examples. In Chapter 1, we said that some special characters ...
20
votes
4answers
3k views

Why does “A=10 echo $A” not print 10?

This command: A=10 echo $A prints an empty line. Why not 10? Why doesn't the in-place temporary environment setting work? I want to know the reason and explanation rather than solution. I used ...
0
votes
1answer
79 views

Bash script not adding variables to session [duplicate]

I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment. #! /bin/bash alias devhm='cd ${DEV_HOME}; ll'; alias wlhm='cd ${WL_HOME}; ll'; alias ...
1
vote
2answers
74 views

What are the standard Environment variables ($) in Ubuntu?

I know some useful environment-variables like $HOME, $UID, $BASH, $LOGNAME etc. which is useful to get information in terminal/command-line with using echo(ex: echo $LOGNAME) I want to know what are ...
1
vote
1answer
201 views

Bash script doesn't execute command from PATH

I have this simple script: #!/bin/bash echo ${HADOOP_HOME} $(hadoop fs -ls) The output is: /opt/hadoop-0.20.2-cdh3u2 ./hello.sh: line 3: Found: command not found So bash definitely sees ...
7
votes
2answers
546 views

Terminal prompt messed up after changing value of PS1

I carelessly entered a command in the terminal that should have been in a shell script: export PS1=$PATH:~/drush23/drush/ now in my terminal instead of this: ubuntu@ip-10-16-134-18:/home/ubuntu$ ...
1
vote
3answers
1k views

Run PHP from the command line

I have installed XAMPP v1.8.3 for my PHP development. I am new to Ubuntu, so I don't know how to set environment variable for PHP which is located at /opt/lampp/bin/php. I can run PHP scripts from ...
0
votes
2answers
245 views

export $PATH not working correctly on Ubuntu 13.10

I have connected to remote Linux desktop (Ubuntu 13.10) using ssh command and try to run following command on remote desktop. On my host machine I am using Ubuntu 12.04. On remote desktop: I have ...
-1
votes
1answer
200 views

Environment Variables and .bashrc [closed]

I need Help in this: that is how to do this Edit the setting file of the user. In our case it should be in the root directory of the user and the name is .bashrc or .bash_profile 2.- Add the ...
1
vote
1answer
1k views

NDK_ROOT enviroment variable defined but script does not see it

In my ~/.bashrc i have this: export ANDROID_SDK=~/Devel/android_dev_x64/sdk export ANDROID_NDK=~/Devel/android-ndk-r9d export NDK_ROOT=$ANDROID_NDK export ...
2
votes
1answer
233 views

How to know which processes have the DISPLAY variable set?

Sometimes I face some problems in display and mostly I do want to know which files or processes are using the DISPLAY environment variable. So how to list all processes that having DISPLAY set?
0
votes
3answers
129 views

Command line to add a directory to the PATH if it's not already there

In regular way to add a directory to PATH: PATH=$PATH:/new-directory Now the problem is if you add a new directory to the PATH then it will be added without checking if it's already in the PATH or ...
0
votes
3answers
108 views

Strange autocompletion behavior

Well...I'm so confused, cause the only real problem in my case is freaking apostrophe ('). Situation: expanding PATH variable influence word completion, based on whether was apostrophes in additional ...
0
votes
1answer
178 views

Why environment variable disappears after terminal reopen? [duplicate]

I've tryed to add environment variable in terminal: loom@loom:~$ export DOOM=/home/loom/doom/ loom@loom:~$ echo $DOOM bash: /home/loom/doom/: Is a directory Then I've closed terminal and reopened ...
0
votes
2answers
265 views

Save enviroment PATH once I added one

I'm trying to add an environment path for android studio, and I've done the following steps: checking is there is already: echo $PATH add my path: export ...
1
vote
6answers
582 views

What are the Default $PATH Values?

On Mac OS X, the default $PATH values are: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin What are the default values on Linux?
0
votes
3answers
78 views

Why is $PATH used as a variable?

Couldn't there be a config text file instead?
1
vote
1answer
146 views

Ubuntu .pam_environment for non-login shell

I remember in the past, we have two place to set env variables for Ubuntu Login shell - ~/.profile Non login shell - ~/.bashrc But now according to the doc [1], they are not recommended anymore. ...
0
votes
2answers
575 views

Where should I add/modify environment variables?

I would like to edit my .bash_profile file. However it appears that in Ubuntu (and perhaps other Debian distros) this is named as .profile. However I cannot seem to find the expected variables like ...
0
votes
2answers
1k views

PATH-variable gets always reset. How to fix that?

A little time ago, I found out, that I can create custom commandterminals with expanding the PATH-variable. Unfortunately, it gets always resettet, when I close the terminal and opens it again. Do ...
0
votes
2answers
3k views

Ubuntu adding path/Environment variables

I am trying to install apache maven 3 in Ubuntu 12.04 lts. What I did was open the terminal then I typed the following commands export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5 [Then ...
0
votes
2answers
861 views

How to Import a Variable from a Script?

I want to get a variable from another script, as demonstrated in http://stackoverflow.com/questions/5228345/bash-script-how-to-reference-a-file-for-variables However, the answer uses source command ...
2
votes
3answers
273 views

How to declare functions as variables

I want to declare variable with pwd() function, which will give me the current path. I want to use pwd() function as ${pwd} variable, something like that. How I must write? Thanks!
0
votes
1answer
326 views

How I can I unsource my environment?

I have source my environment and some environment variables were set, but i need to shift back to my previous environment, how should i do it ? Is there any way to move to the last environment ?
1
vote
3answers
1k views

Why won't environment variables added to .profile show up in screen

I'm running Ubuntu 12.04 I added export LD_LIBRARY_PATH=/home/dspies/workspace/hdf5-1.8.11-linux-shared/lib to .profile but when I log in and open terminal and put echo $LD_LIBRARY_PATH there's ...
3
votes
1answer
52 views

Environment var _

I send a printenv command in the commandline and I see one of the variables is the following: _=/usr/bin/printenv I now do this: mo@mo-Toshiba ~/Workspace $ printenv _ /usr/bin/printenv but when ...
30
votes
5answers
34k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
2
votes
1answer
195 views

Lost PATH variable content

I was trying to add something to the PATH with : export PATH=/user/home/sbt/bin but I removed all of the content of PATH and I can not run any command on the terminal even ls ! So what should I do ...
3
votes
2answers
345 views

Why isn't ubuntu checking the correct directory in the $PATH variable?

I'm trying to run a program redis-cli $ ls -lh /usr/local/bin/ | grep redis -rwxr-xr-x 1 root root 4.2M Mar 24 19:49 redis-cli -rwxr-xr-x 1 root root 5.6M Mar 24 19:49 redis-server $ echo $PATH ...
4
votes
2answers
202 views

Program in $PATH not being found

I am running xubuntu 12.1, and am having some difficulty getting a program I have added to my path to execute. The program I am attempting to execute is scan-view, from Clang. I built Clang from ...
5
votes
1answer
69 views

What is the difference that explains different results of different ways to assign values in a command-line?

What is the difference that explains the different results of these commands? a=2 echo $a set a=2 echo $a a=2; echo $a set a=2; echo $a
1
vote
1answer
331 views

How to I insert a command into a script located on a remote server?

I want to insert rm $0 in a script (/home/user/config-script) located on remote server with echo "rm $0" >> /home/user/config-script with expect. But fail because expect interprets $0. ...
1
vote
1answer
1k views

How can I install nbconvert?

I tried installing nbconvert via the instructions on their readme. The curl line and the pip install line worked flawlessly, but I can't decipher what is meant by: You will need to either put the ...
4
votes
3answers
15k views

How do I reset proxy in terminal to automatic if not connected via proxy

I tried to reset proxy of the terminal by some commands but it doesn't happen and automatically switches back to this proxy 172.16.0.16 (which apparently was my college proxy). I checked in my ...
3
votes
3answers
2k views

Cannot use “./” to execute a shell script

Maybe someone here would be able to help me out. Have installed Ubuntu 12.04 LTS (kubuntu) on two machines. The .bashrc and .bash_profile files are identical as the file structures on each machine is ...
3
votes
2answers
59 views

I want to pass an argument into a variable?

I am very new to the Linux environment, and I am stuck with a situation. What I want to do is to pass the command test -s $testFile to a variable, like, say "tes" Example: tes="test -s $testFile"
2
votes
1answer
270 views

Why does running `time` and `/usr/bin/time` give different results?

Why does running time and /usr/bin/time give different results? /usr/bin/time thomas@tbdesktop:~$ /usr/bin/time -f "Elapsed time:%E" wc /etc/hosts 9 25 224 /etc/hosts Elapsed time:0:00.04 time ...
1
vote
3answers
2k views

PATH variable resets with reboot

Just as the title indicates my PATH variable resets after every reboot. I read that I have to edit my bashrc file's PATH variable, but I don't have anything there that suggests anything related to the ...
0
votes
1answer
258 views

How to read the password from variable?

I am trying to move my file to another system which is located in some other place, with this command: rsync -avrz src destination It works fine. But what I need is to put this command in shell ...
1
vote
2answers
380 views

How do I set and use shell variables?

IRSTLM=$HOME/irstlm I need help setting this variable up. Was wondering if this is correct syntax IRSTLM=/home/user/irstlm Is that possible to run from root? I need it to be done in root in order ...
9
votes
5answers
11k views

difference between bash.bashrc and /etc/environment file

Till data I was used to set my environment variables in the bash.bashrc file. Recently I told to use the /etc/environment file. Well, both work fine. So, what is the difference between them? I ...
4
votes
2answers
10k views

How can I reset $PATH to its default value in Ubuntu 11.10?

I accidentally unset all the directories of $PATH while trying to add a new one in ~/.bashrc. I opened a new terminal window as I was editing and now $PATH is empty. I'm worried if I boot from another ...
1
vote
1answer
169 views

Unable to press 'E' key in bash when I add export EDITOR=vim in /etc/inputrc

When I add the line export EDITOR=vim into /etc/inputrc and start a new session in BASH, I am unable to press the E key on the keyboard. (Well, I can press it, physically, but nothing shows up in the ...
5
votes
4answers
165 views

Why doesn't changing a variable in a script alter it outside the script?

Let's say I export a variable with the terminal. After that I call a script that alters that variable to something else. But when I return to the terminal and echo the variable, it remains as its ...