Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hajime

macrumors 604
Original poster
Jul 23, 2007
7,737
1,218
Hello, I am using 10.8.5. I installed a program which is supposed to do all the settings during installation. However, when I tried to use it via an xterm, I got "bash: abc: command not found". During installation, I installed it to the default directory /usr/local. Under /usr/local/abc/bin, I found some of the programs related to the one I just installed. When I tried to run the main program by doing "./abc", I got: "You need to set the ABCDIR environment variable to point to the ABC installation directory before you can run anything."

When I typed: "less ~/.bash_profile", I found the following:

# ABC Setup
ABCDIR=y/abc
PATH=${ABCDIR}/bin:${PATH}
export ABCDIR PATH
. ${ABCDIR}/etc/abcconf/abc.sh



Could anybody please let me know what to do? Thanks.
 

pmau

macrumors 68000
Nov 9, 2010
1,569
854
Since you seem to be using bash, try

Code:
export ABCDIR=/location

Before invoking your program.
 

hajime

macrumors 604
Original poster
Jul 23, 2007
7,737
1,218
Since you seem to be using bash, try

Code:
export ABCDIR=/location

Before invoking your program.

I typed "export ABCDIR=/usr/local" but I still got the same error message about the need to set the ABCDIR environment variable.

I worry that if I make a mistake, I will mess up the system. Could you please be more explicit on what I should change in that line? I am supposed to install the program in /usr/local

Thanks.
 
Last edited:

pmau

macrumors 68000
Nov 9, 2010
1,569
854
Without any detail on what you are doing we are both wasting our time.

Let me explain some basics to you:

If you are in a Terminal, xterm or any "shell" environment, programs are found using the PATH environment variable.

If you type "ls -la .", the program will be found in "/bin" for example.

The program you installed (you did not tell what kind of program) has added a few commands to your bash profile, to populate your environment with the correct settings.

Since that did not work, you have to figure out where this is failing:
Code:
# ABC Setup
ABCDIR=y/abc
PATH=${ABCDIR}/bin:${PATH}
export ABCDIR PATH
. ${ABCDIR}/etc/abcconf/abc.sh

To do so you have to enable script execution debugging in bash
Code:
set -x

Now, simply copy and paste the lines above in your shell and see what happens.

The last line executes a script: ". ${ABCDIR}/etc/abcconf/abc.sh"
which will be the most important part of your journey.

It's quite simple but you provide next to no information because ABCDIR and "abconf.sh" is certainly not the real thing.

Good luck.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.