tags:

views:

32

answers:

1

I have two Linux xterms with "almost" the same setup. One setup works and the other doesn't for my application.

Is there a tool that can help me figure out which particular environment variable is causing the failure? (A visual diff)

Currently - I do

env > a1
env > a2

in the 2 xterms and do a diff on them.

But would like to know if there is a tool which can help me save some time. Thanks

A: 

Putting together the comments of @msw and @Adam Byrtek (which I voted up) we get something like the following. Note that diff has a --side-by-side option that works well if you don't have X:

a1 $ env | sort > a1
a2 $ env | sort > a2
#somehow get the files on the same host

a2 $ meld a1 a2
# or, in a terminal setting
a2 $ diff --side-by-side a1 a2

Things to look for are PATH, LD_PRELOAD, and any APP vars like JAVA_HOME, PYTHON_PATH, or RUBYPATH.

Paul Rubel