3
votes
1answer
39 views

How to quickly check the value of bash variables, aliases and history commands from terminal?

How do you expand in place: bash aliases environment variables history commands to edit them and check they are correct? For example, I have some aliases I use for flashing different devices and ...
1
vote
2answers
61 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 ...
18
votes
3answers
297 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
25 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 ...
0
votes
2answers
38 views

How do I set environment variables through a keyboard shortcut?

I have a script that increments an environment variable, but it only works if I run it by perpending it with "source" or with a ".". Unfortunately, this means that if I attempt to bind it to a key, I ...
3
votes
2answers
241 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 ...
0
votes
1answer
91 views

Permanent PATH variable

How will I make this /media/De Soft/mongodb/bin PATH variable permanent? Everyone is saying export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv depending on your ...
1
vote
2answers
38 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 ...
21
votes
3answers
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
95 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
79 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 ...
4
votes
3answers
1k views

Tomcat does not recognize JAVA_HOME

I've installed Ubuntu 14.04 Server, extracted JDK1.8u5 and Tomcat7, and added the following to .profile (I also tried adding it to .bashrc with similar [non-] results): export ...
1
vote
1answer
58 views

Solving $PATH obfuscation by /bin/sh (dash)

This question is a follow-up from http://unix.stackexchange.com/questions/126955/percent-in-path-environment-variable. I post it here, since it is more distro-specific. The shell used by default for ...
1
vote
1answer
284 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 ...
-1
votes
1answer
271 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 ...
3
votes
1answer
245 views

Why are 'source' and '.' not always the same, when they're supposed to be identical?

I was under the impression that source was a synonym for . in bash. However, it seems that in the .profile file, source doesn't work. This youtube video demonstrates that when source is used in ...
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 ...
1
vote
1answer
371 views

Call shell script “inline” in another shell script

So the bottom line here is that I am trying to have one go-to script work to set environment variables (let's call it setenv.sh) that will be used in subsequent scripts. In Windows (I know, that is a ...
2
votes
1answer
95 views

bashrc shortcuts in Tmux

I have sets many shortcuts in .bashrc profile of local user, and they work properly. Currently on my 12.04 system but when ever I tried to used them in tmux, I always get the same response command not ...
1
vote
1answer
344 views

setting PATH to /etc/profile or /etc/environment does not work with sudo

I want to launch Intellij IDEA IDE via sudo idea.sh. sudo because IDE needs to manupulate files from /etc/share. idea.sh is placed at /home/<username>/<path>/bin/idea.sh. I tried to add ...
0
votes
3answers
112 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
708 views

export PATH doesn't work correctly

I have a problem with $PATH export. The only place I found where I modify $PATH is /etc/environment: ANDROID_HOME="/opt/ADT/adt-bundle-linux-x86_64-20130522/sdk" ...
0
votes
1answer
186 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
308 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 ...
0
votes
0answers
47 views

help changing an environmental variable

I need a little help with this syntax. Do I use the quotes? Do I add these variables to .bashrc or bash? Are bash and .bashrc the same file? Where is the .bashrc file? What is the "." leading the ...
0
votes
2answers
394 views

How to change environmental variable permanently?

I am trying to use third party packages in Python. To import all the modules I need to update PYTHONPATH. I read several blogs on it but still I have following questions unanswered. Is sys.path ...
0
votes
0answers
111 views

PATH variable to Apache OPENNLP OK but doesn't work

yesterday I installed in my Ubuntu AWS 12.04 (Amazon) micro istance OpenNLP and seemed working. Today when digiting opennlp:command not found Following suggestions found here: I modified my ...
1
vote
2answers
58 views

How to get the directrory name in shell script

I have a script which sets some environment variable to paths: export VAR1=/home/xyz/DIR_IN_WHICH_THIS_FILE_EXISTS export VAR2=$VAR1/abc/qwe ... Can I use something to get the ...
0
votes
0answers
94 views

application settings and environmental variables

I was perusing an article on environment variables on wikipedia: http://en.wikipedia.org/wiki/Environment_variable One of the environment variables is PATH and you can access this environment ...
1
vote
2answers
128 views

What happens if I manually change the USER environment variable

After running env in the terminal to check if some of my other variables were persistant across settings I noticed the USER=xxx environment variable. I've had to reinstall Ubuntu before after fooling ...
4
votes
2answers
184 views

Something wrong with my `.profile`

I recently installed a few softwares and needed to add their bin/ directories to my PATH. Nothing abnormal so far. But I decided to be smart about it, and rewrote a part of my .profile so I didn't ...
0
votes
1answer
126 views

Set command can't handle lines constituting of a \n (word/line counting script)

I have a problem with execution of a while loop, I have found out that the problem involves the execution of the set command, the assigment of the \n character to an environmental variable ...
1
vote
1answer
148 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
0answers
19 views

adding directory to path environment variable doesn't remain in path [duplicate]

I have been trying to get a program called "passenger-memory-stats" to run as the super user. The program is installed in the following directory: /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby . I ...
0
votes
0answers
20 views

Where to set environment variables for all users [duplicate]

Apologies in advance if this question is very simplistic! I have Ubuntu 12.04. I manually installed Maven by downloading the binary tarball file and extracting it to the /opt/ folder. I then set the ...
0
votes
2answers
614 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
168 views

How to set environemt variable without rebooting Ubuntu?

Problem: During Android development, in order to add ADB path to environment variable; I did following things in short- gedit /etc/environment - Added my desired path in the file such as ...
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 ...
1
vote
0answers
202 views

javac cannot found, even after adding non-standart path to it in $PATH

Ubuntu 12.10, 32bit Problem too damn simple: I have a NTFS partition and unpacked from .tar.gz jdk on it. All I need from bash, is to see javac compiler, that is located in directory ...
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
1k 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
279 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!
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 ...
0
votes
1answer
136 views

Environmental Variable for current domain

I'm using Ubuntu 12.04 LTS Desktop edition I want to use environmental variable for currently joined domain just like I use $USER to bring current user. From what I read there are few variables for ...
0
votes
2answers
4k views

/usr/bin/env: bash: Permission denied

Suddenly, when your Seniors Linux Server admin does not come at office. And Then Junior Linux Admin take a charge of it, then it is NIGHTMARE for them. Please help. I'm not able to recollect, that ...
3
votes
3answers
296 views

Can't get $(date +%F) set as environment variable

I would like to create an evironment variable that will output the current date. I have added the following to ~/.pam_environment: TODAY=$(date +%F) Apparently you have to log out after changing ...
31
votes
5answers
37k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
0
votes
1answer
3k views

How do I set CLASSPATH variable for Tomcat in 12.10?

Previously, I have set the JAVA_HOME path using the terminal with the following command: export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386" >> ~/.bashrc Now, I want to set the CLASSPATH ...
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