Setting PATH on AIX? (Yes I'm a Unix idiot)

Setting PATH on AIX? (Yes I'm a Unix idiot)

Post by Dan Weingar » Sat, 14 Aug 1999 04:00:00


I just got my first RS-6000, but my years of Windows programming are
leaving me kind of clueless in Unix-land.

I'm trying to install the GCC compiler. I notice it puts all of it's
files in \USR\LOCAL\BIN and \USR\LOCAL\LIB.  Unfortunately, these
directories aren't in my PATH so the shell won't find them.

I am logged in as the ROOT/USER.  I don't see any .profile files in my /
directory, although there is a .dtprofile file with some scary comments
in it.

Anyone tell a unix-neophyte how to add \USR\LOCAL\BIN and \USR\LOCAL\LIB
to my environment so I can start compiling stuff?




Setting PATH on AIX? (Yes I'm a Unix idiot)

Post by Bryan VanDeVe » Sat, 14 Aug 1999 04:00:00

> Anyone tell a unix-neophyte how to add \USR\LOCAL\BIN and \USR\LOCAL\LIB
> to my environment so I can start compiling stuff?

depending on what shell you are running:

setenv PATH ${PATH}:/usr/local/bin
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/lib


export PATH=${PATH}:/usr/local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib

Note that unix is case-sensitive and those paths are almost certainly in
lower case.

I might also suggest you take a gander at:

Welcome to Unix, enjoy!


Bryan Van de Ven
Applied Research Labs
University of Texas, Austin


1. zsh's 'typeset -U path' wipes out path/PATH

I've found a bug (or at best a very perverse "feature") in zsh; it
can be illustrated by the following three short scripts:

# script_A
echo $#path
typeset -U path
echo $#path
# eof

# script_B
source script_A
# eof

# script_C
c_fxn () { source script_A }
# eof

Note that both the contents of script_B and the body of the function
c_fxn defined in script_C consist of the same one line, namely
"source script_A".  Now,

% source script_B
% source script_C

In words, when script_A is sourced within a script that is itself
being sourced, typeset -U path preserves the components of PATH
(or at least their number), but if script_A is sourced within the
body of a *function*, calling the function causes the expression
typeset -U path to *clear* the contents of PATH.

Please-please-please don't tell me this is a feature!  I'd lose
all faith in the designers of zsh if this turns out to be a feature!

More importantly, how does one get around this problem.  I've tried
saving the value of $path before calling 'typeset -U' on it, and
restoring it afterwards, but the results have been disastrous (I've
tried too many variants to describe them all).


NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

2. UNIX to UNIX modem connection

3. vnc - failed to set default font path 'unix/:-1'

4. kernel routine: timeout

5. set path = "$path" hoses path in tcsh -- why???

6. Abit IT5V + SDRAM + 166MMX

7. GGI: yes, yes and yes

8. AfterStep Problem

9. AIX 4.3.2 smitty 'chgsys' Fast Path

10. idiot's guide to unix/linux

11. Setting path when doing 'su' to root...

12. Question about path setting after issueing the command 'su'

13. Paths don't seem to be set, Help please, yep I'm a newbe