bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: declare -g reports as invalid option on MacOS (10.14.6) Bash (5.0.1


From: Ray Sutton
Subject: Re: declare -g reports as invalid option on MacOS (10.14.6) Bash (5.0.11)
Date: Sat, 31 Aug 2019 09:35:34 -0600 (MDT)

Firstly thanks for the help, I must be getting too old for this S*** to
no see the blindingly obvious.

The shell was getting invoked via split screen in ITerm or by source
.bash_profile. My big mistake was using bash -version rather than echo
$BASH_VERSION to investigate. By time it got to 'bash -version' the path
had been setup and /usr/local/bin was taking precedence over /bin so it
appeared as if the correct version was running.

The root cause was missing the chsh step after installing bash 5.

Again thanks

Ray Sutton


On Sat, 31 Aug 2019 09:06:35 +0200, Andreas Kusalananda Kähäri wrote:

> On Fri, Aug 30, 2019 at 06:03:37PM -0600, Ray Sutton wrote:
> > Firstly apologies for not using bashbug, I'm having an issue on a
> > machine I'm rebuilding and don't have email readily available yet
> >
> > The issue is on a late 2013 MBP running MacOS 10.14.6 and
> > bash -version reports 5.0.11(1)-release (x86-64-apple-darwin18.6.0)
> >
> > The error is occuring in my .bash_profile and reports as
> >
> > -bash: declare: -g: invalid option
> > declare usage: declare [-afFirtx] [-p] [name[=value]...]
> >
> > Which does not agree with the man page.
> >
> > My work MBP (mid 2014) is running exactly the same version of both
> > MacOS and bash, the problem doesn't occur there
> >
> > In both cases bash was installed via brew.
> >
> > The behavior seems consistent with the original bash 3 declare
> > statement persisting after the bash 5 install which seems unlikely.
> >
> > Any Advice on how to fix this issue?
> >
> > Thanks
> >
> > Ray Sutton
> >
>
> It seems likely that you are in fact running /bin/bash
> (3.2.57(1)-release, from the macOS base system) instead of
> /usr/local/bin/bash (5.0.11(1)-release, current bash from Homebrew).
>
> How do you start your bash login shell?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]