linux - what is PATH on the MAC (UNIX) system -


im trying setup project , storm git https://github.com/nathanmarz/storm/wiki/setting-up-development-environment

download storm release , unpack it, , put unpacked bin/ directory on path 

my question path mean, want me ?

sometimes see /bin/path , $path, echo path

can explain concept of path , can setup in future without blindly following instructions?


this techincal question. maybe trival professionals. entry people me need guides. dont understand why people trying close question.

path special environment variable in unix (and unix-like, e.g. gnu/linux) systems, used , manipulated shell (though other things can use it, well).

there's terse explanation on wikipedia, it's used define search executable files (whether binaries, shell scripts, whatever).

you can find out current path set simple shell command:

: $; echo $path 

(note: : $; meant represent shell prompt; may different you; know whatever prompt is, that's i'm representing string.)

depending on system , prior configuration, value vary, simple example of output might like:

/usr/bin:/bin:/usr/local/bin 

this colon(:)-separated list of directories in search executable files (things ls, et cetera.) in short, when try execute command shell (or within other program in ways), search through each of directories in list, in order, looking executable file of name you're provided, , run first 1 finds. that's concept, per question.

from there, documentation telling add directory you've unpacked software, , in particular bin subdirectory, $path variable. how depends bit on shell you're using, (bourne-compatible) shells, should able this, if you're in directory bin directory is:

: $; path="$path:$pwd/bin"; export path 

in actual bourne shell, can shortened to:

: $; export path="$path:$pwd/bin" 

(i won't bother explaining csh-compatible shells (because: agree other advice don't use them), similar can done in them, well, if happens environment of choice reason.)

presumably, though, you'll want save shell-specific configuration file (could ~/.profile, ~/.bashrc, ~/.zshrc... depending on shell), , without reference $pwd, rather whatever expanded to. 1 way might accomplish this:

: $; echo "export path=\"\$path:$pwd/bin\"" 

and copy/paste resulting line appropriate configuration file.

of course generate appropriate command in other ways, if $pwd isn't bin directory is.

see also:


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -