1
vote
2answers
35 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
61 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
71 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
121 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
526 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
668 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
184 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
139 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
964 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
197 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
105 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
103 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
159 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
201 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
442 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
136 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. ...
-1
votes
0answers
184 views

Tab completing directories when exporting variables in bash 4.2

I will start by mentioning this is a different issue (but perhaps related) to the escaping of dollar signs when tab completing variables. What I am trying to do is this. When exporting a variable ...
0
votes
2answers
529 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
865 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
2k 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
702 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
257 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
264 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
928 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 ...
27
votes
5answers
29k 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
184 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
324 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
192 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
328 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
14k 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
261 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
250 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
367 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
10k 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
9k 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
167 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
161 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 ...
6
votes
3answers
10k views

How do I install the Instant Messaging application IP Messenger?

I've recently downloaded g2ipmsg (IP Messenger for Ubuntu 11.10). However - this comes not as an installable package as previous ubuntu versions. Thus I think I need to compile it. This application ...
10
votes
2answers
14k views

Environment variables when run with 'sudo'

As example to my question, my ~/.bashrc file contains this lines: > export LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH > export LD_PRELOAD=/opt/intel/mkl/lib/ia32/libmkl_core.so ...
2
votes
1answer
568 views

How do I get Guake(terminal) to report the correct terminal?

I've been using Guake on my laptop and my desktop and everything has been fine until I recently bought a new HD and did a fresh install of Ubuntu 10.10. I installed Guake and it works fine except for ...
4
votes
2answers
3k views

Can't echo $CATALINA_HOME

When I echo $CATALINA_HOME I get a blank line, but when I ls $CATALINA_HOME I correctly get a listing of the directory. Why can't I echo it? I am running Ubuntu 11.04.
4
votes
2answers
2k views

How to recall history in teminal

I installed Ubuntu 10.10 yesterday. Then while using the terminal I noticed that once I quit a terminal session its history is gone, although history exists for applications in terminal ...