PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 21, 2022

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

 August 21, 2022     bash, environment-variables, macos, unix     No comments   

Issue

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?


Solution

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



Answered By - felps321
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing