Why does '/opt/local/bin' takes precedence over '/bin' despite `$PATH`? [closed] - bash

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
Bash that comes with macOS is of version 3.2.57 (the '/bin/bash'), however, I also have Bash version 5.1.12 which lives in '/opt/local/bin'.
I'm interested in why the latter is used when I execute 'bash' despite that '/bin' goes after '/opt/local/bin' in the $PATH variable?

It turns out that the $PATH is read from left to right and the first match takes precedence

Related

What is difference of 'bash' and '-bash'? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
When I run the ps -f command on Linux, the output shows 'bash' and '-bash'. I think there must be some diffrence between them. Is there someone can explain it, especially '-bash'? What is the meaning of the leading hyphen?

Meanings of ".1", "#" and "*" in Mac OS library file names [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am working with two library files on Mac OS. Here are how they look like when I use ls
libmkl_rt.1.dylib*
libmkl_rt.dylib#
i have three questions on the file names:
What does ".1" mean?
What does "*" mean?
What does "#" mean?
I am not sure what the .1 means, but I believe * means executable, and # means symbolic link, given a thread found on the Unix StackExchange, see: https://unix.stackexchange.com/a/96132

How can I see my actual directory in my bash prompt? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I installed bash in my Anaconda prompt, and this is what I'm seeing:
bash-4.3$
and I would like to see something like:
zzzz#zzvdhdc/users/xxx/myactualdirectory
use \w for the current directory:
PS1='\w $'
see man bash for more options to change your promt.

Where should I cp oc binary to on MacOS? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
In this documentation it says
unpack the archive and move the oc binary to a directory on your PATH
I tried echo $PATH and it returns:
bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
Clearly there are multiple path here, which one should I move cp oc binary to?
/usr/local/bin would be the usual choice for user or third-party executables. That way it won't get wiped out when you update the OS.
See also: Where do you keep your own scripts on OSX? - the question is about scripts rather than binaries, but the same logic applies.

Why is my "ls -A" displaying current and parent directory (even if should not?) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm writing a little bash script.
As written in the reference:
http://linuxcommand.org/man_pages/ls1.html
ls -A
Should not list "./" and "../" directories.
But... on my system (centOS) is still listing it.
Is there some option "always on" I should be take care of before running this script?

Resources