Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: unusual question about PATH variable

1 view
Skip to first unread message

Art Werschulz

unread,
Mar 8, 2005, 9:55:17 AM3/8/05
to
Hi.

str...@yahoo.co.uk (championsleeper) writes:

> "A binary cannot be found in a directory which is listed in your PATH
> variable (but may be in one of the directories listed in PATH).
> Running the command:
> ____ PATH allowable
> fixes the problem. What should the expression be?"

If I'm understanding the question properly, the answer should be "export".

--
Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y?
Internet: agw STRUDEL cs.columbia.edu
ATTnet: Columbia U. (212) 939-7060, Fordham U. (212) 636-6325

Moe Trin

unread,
Mar 8, 2005, 9:17:14 PM3/8/05
to
In article <103a78f3.05030...@posting.google.com>,
championsleeper wrote:

>i've completed a certfication exam for linux recently. there was one
>question i could not answer and have had trouble finding an answer for.

Did you take classes for this exam? Asking the instructor is likely to
be the best way.

>"A binary cannot be found in a directory which is listed in your PATH
>variable (but may be in one of the directories listed in PATH).

Doesn't make sense. The 'which' command will search your path for files,
whether they be executable or not - they just have to be in your path.

>Running the command:
> ____ PATH allowable
>fixes the problem. What should the expression be?"

On your system, run the following commands:

zgrep allowable /usr/share/man/*/*
zgrep allowable /usr/share/info/*

and see if anything turns up. There's nothing obvious here. Another problem
is the word PATH - that's normally an environmental variable.

>Afraid this is all I could remember and I could not take my notes out
>of the exam.

I'm afraid the question doesn't sound correct. The 'which' command (often
just an alias for 'type -path') will find stuff that is in your path. Try
this (assumes you have a ~/bin directory, and that this is in your path):

[compton ~]$ which foo
[compton ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/ibuprofin/bin
[compton ~]$ ls bin/foo
[compton ~]$ > bin/foo
[compton ~]$ which foo
/home/ibuprofin/foo
[compton ~]$ ls bin/foo
bin/foo
[compton ~]$

and obviously, that isn't even an executable.

>Any guidance appreciated. Doing my head in .......

[compton ~]$ whatis which whereis
which (1) - show full path of commands
whereis (1) - locate the binary, source, and manual page files for a command
[compton ~]$

The difference? 'which' searches your PATH, while 'whereis' searches through
a number of directories where executables might live (but not through the
~/bin/ if it exists).

Old guy

0 new messages