> On Aug 12, 2024, at 09:44, Bill Cole 
> <[email protected]> wrote:
> 
> On 2024-08-12 at 08:14:54 UTC-0400 (Mon, 12 Aug 2024 14:14:54 +0200) 
> Bas Jansen via macports-users <[email protected] 
> <mailto:[email protected]>> 
> is rumored to have said:
> 
> Hi,
> 
> When doing a self update via Terminal, I get the following warning:
> 
> ~$ sudo port upgrade outdated 
> Nothing to upgrade. 
> ---> Scanning binaries for linking errors 
> Warning: Error parsing file /opt/local/bin/g[: Error opening or reading file 
> ---> No broken files found. 
> ---> No broken ports found.
> 
> Emphasis mine, of course. There is no file “g[“ in /opt/local/bin/. I ran 
> this using macports 2.10.0, macOS Sonoma 14.6.1 on an Intel MacBook Pro, late 
> 2019. Anyone know what this means?
> 
> If you've installed the coreutils package, /opt/local/bin/g[ *should* exist. 
> It is the GNU version of '[' which is better known as 'test'. You may be able 
> to resolve this by reinstalling coreutils.
> 
> I do not know the history of why '[' exists apart from 'test' but it does, in 
> most systems as a hardlink. The MacPorts coreutils package includes both as 
> distinct files.
> 


Instead of saying

test -r $file

you can say

[ -r $file ]

I've seen it before that builtins are also separate commands on various 
systems; there must be some requirement. Some implement that by using a script 
of one of the shells that has the builtin, or with a special executable that 
implements a bunch of such commands via hard links.

Reply via email to