Bash env issues

Chris F.A. Johnson chris-E7bvbYbpR6jSUeElwK9/Pw at public.gmane.org
Thu Feb 7 18:57:37 UTC 2013


On Thu, 7 Feb 2013, William Muriithi wrote:

> Morning
>
> Came across an odd issue and wonder if someone can explain if its normal.
>
> I set my java home on  /etc/environment and assumed it should work across
> accounts.
>
> -bash-4.1$ cat /etc/environment
> JAVA_HOME="/usr/bin/java"
>
> When I ssh in, I can see its working when I type env.  However, if I "su -
> jira" to a system account, or even another user account, java home don't
> show up on env.

    Bash doesn't source /etc/environment.

    Put it in /etc/profile.

-- 
    Chris F.A. Johnson, <http://cfajohnson.com/>
    Author:
    Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list