Tagged Questions

3
votes
1answer
352 views

dot file not sourced when running a command via ssh

When I run my program interactively, it works fine: ssh somehost $ ~/some/path/somescript.py When I run my program over ssh directly, it doesn't work. The variable PYTHONPATH is not set, because ...
12
votes
5answers
254 views

How to determine where an environment variable came from

I have a linux instance that I set up some time ago. When I fire it up and log in as root there are some environment variables that I set up but I can't remember or find where they came from. I've ...
8
votes
4answers
548 views

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to PATH environment variable. I know this is accomplished editing .bash_rc (for example), but it's not clear how to do this. This way: export ...
3
votes
4answers
1k views

Export an env variable to be available at all sub shells, and possible to be modified?

Suppose I have export MY_VAR=0 in ~/.bashrc. I have an opened gnome terminal, and in this terminal, I change $MY_VAR value to 200. So, if I do echo $MY_VAR in this terminal, 200 is shown. Now, ...
9
votes
3answers
1k views

How to print all environment variables defined (but not necessarily exported) in bash

The bash builtin command set, if invoked without arguments, will print all environment variables, but also all defined functions. this makes the output unusable for humans and difficult to grep. How ...
4
votes
1answer
114 views

How can I make variables “exported” in a bash script stick around?

I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as $EC2_HOME, using a script. I have have a shell script set up like this: #!/bin/sh export ...
4
votes
1answer
226 views

Where have I set my bash PATH?

I want to remove ~/bin from my PATH.  I set it up months ago when Linux (Ubuntu) was very new to me, but I don't know how I added it... Nothing shows up when I search all the files listed below. ...
4
votes
2answers
84 views

Why do newlines mess up my while condition?

I have a while loop that allows setting variables when written one way but does not allow it when written another way. Why is that? This prints var as 1234 and does not print var2 #!/bin/bash ...
0
votes
2answers
53 views

Way to determine where certain global parameter is configured

I wonder if there is a way to determine the location of the file where certain configuration exists. For example know that I have a global parameter TMOUT and I want to change it, but I don't know ...
0
votes
2answers
126 views

Trying to set JAVA_HOME in ~/.bashrc

I have added this line at the end of ~/.bashrc file. export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java But when I do echo $JAVA_HOME I don't get anything as output, I expected ...
0
votes
1answer
67 views

Shell script executing in the terminal but not from shell script file [closed]

Possible Duplicate: How can I make variables “exported” in a bash script stick around? I have a problem with executing script from file. When I type in command line ...