unusual question about PATH variable - Questions

This is a discussion on unusual question about PATH variable - Questions ; hi, 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. here's the scenario: "A binary cannot be found in a directory which is listed in ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: unusual question about PATH variable

  1. unusual question about PATH variable

    hi,

    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. here's the scenario:

    "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?"

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

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

  2. Re: unusual question about PATH variable

    Hi.

    strepxe@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

  3. Re: unusual question about PATH variable

    In article <103a78f3.0503071437.76bd3086@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

+ Reply to Thread