Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14411

Re: declare(1) not executing inside source'd script

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Frank <sales@eec.com>
Newsgroups gnu.bash.bug
Subject Re: declare(1) not executing inside source'd script
Date Fri, 27 Jul 2018 11:28:55 -0400
Lines 61
Approved bug-bash@gnu.org
Message-ID <mailman.4336.1532705372.1292.bug-bash@gnu.org> (permalink)
References <20180727042606.EFCD8120EA6@student.eeconsulting.net> <20180727141701.rt26jd6vymkf6uwb@eeg.ccf.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0 (1.0)
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1532705373 7275 208.118.235.17 (27 Jul 2018 15:29:33 GMT)
X-Complaints-To action@cs.stanford.edu
Cc frank@eec.com, bug-bash@gnu.org
To Greg Wooledge <wooledg@eeg.ccf.org>
Envelope-to bug-bash@gnu.org
X-Mailer iPhone Mail (15F79)
In-Reply-To <20180727141701.rt26jd6vymkf6uwb@eeg.ccf.org>
X-Provags-ID V03:K1:KF6nY9gF248VOeerS83sUL6Uyw4kh36CsqgWonRvJmwqlxCAACf zRqkeCZv6y6xPVaMDVSpa1q4/JROldR3LjDEAYaYMj2h+CaqQ93hElHw7Ce4kw6yndQH6du l2OXjbS8g/Xn9Z2rkzkSeL7MB8UhAF412uaI8FBfhVDGbnNg10jIZzmgxbFNSCDXBoPmZ+8 lgUl+yGr6FMuvAwp5+tbQ==
X-UI-Out-Filterresults notjunk:1;V01:K0:RWl68rWqAD4=:5+6Kb3yzUtdIJIWqGvQP0c aWV4cxGq+jCVlulJFhdVHI/+NpQuBIDyeusmSOzcEJ55SK0S89RsBkbtqrxvROaobZR8INq/i OvrPYDOGPQve6CHLAkQYKeqJ4plqApuEvyr5xaCQM3LBSNsOljBkycslCJZlNo5WBcNLW/zi1 4CuMVknpHfT11UfetqYb9pB7gZVbsrxDve3O32AZgS9KzT6rhwggRVUUHDrCTahTi3S3z/ych wu2CwA0t8Ntff5BQvNNUxfmIKm+vvfC4I4iWSf2S0fRJW7QQNF0zxWZR+OF0Y3sjb27dcm4Ct Qgri/w4ekoUxw8NgcGwGo8fLVlboT7aOln9L5OpQrsDYW3xFzkly9+2h0tFlbEUeh4juHUmHK sJJFd7EMBaJGtCAnpqMIMv7y55OS6t3/qXquFgxMamkTjd8bRTbq/dDWz/KPsQt/qEXRe2qQE 9EmW/zYMJEogrQb51Wm99tUy6Z3RxCUrkBy+/4dpSBCmPE/0W1sTNmpkKqDOA7KWEL02HjBo/ djd7URTE6lVn8D3PVVXoPBT5zuKX86LjweCu2LjUglBGkbbzRjygDwdZk6sRRVimV+UDkTpn+ XPai71v9L6cLcSoZL98hxkRnqQVCbV6AqaJ++xN3YjCT0P3FRm19tr1ZFBVTz/h2vF5CihxSN QmkRX3EsSlTA5m0SfwQ/ogA78LRwhIedTDQtbIVCQyejl+sj8Dz9ARSIaMIIF9gwupIIVWjy9 YP/eTOopCRdHjnFm
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 74.208.4.197
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14411

Show key headers only | View raw


Hm.  Strange.  I will examine the environment for weirdness regarding BASH_ENV or anything else that might be an issue.  Given that it happens for me in both the stock bash 4.2.46 and the locally built 4.4 (on CentOS 7.4), there must be something common to both and thus external to the shell itself.

I have installed bashdb on this system as well, but I don’t expect that to have affected anything since it’s an add on that Bash shouldn’t have noticed without the use of --debugger.

Thanks for your help.

PS:  So the official line is to not specify the man section for builtins to the shell?  I will not use section numbers in the future. :)
--
Frank Edwards
Edwards & Edwards Consulting, LLC
Hours:  10A-6P ET
Phone:  (813) 406-0604

Sent from my iPhone.  No electrons were harmed in the creation or transmission of this message.

> On Jul 27, 2018, at 10:17 AM, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
> 
>> On Fri, Jul 27, 2018 at 12:26:06AM -0400, frank@eec.com wrote:
>> Repeat-By:
>>    $ cat <<__EOF__ >/tmp/bashbug.bash
>>    > function myfunc {
>>    >     echo "Running..."
>>    > }
>>    > declare -fx myfunc
>>    > declare -p -F | grep "myfunc"
>>    > __EOF__
>>    $ source /tmp/bashbug.bash
>> 
>>    The function is now defined, but is not exported.
>>    And the output of the last command never appears,
>>    but if the same command is executed now -- at
>>    the interactive shell prompt -- it does show that
>>    'myfunc' is defined.
> 
> I cannot reproduce this, either in Debian's bash 4.4, or in bash 5.0-alpha.
> 
> wooledg:~$ exec bash-5.0-alpha
> wooledg:~$ cat foo
> function myfunc {
>  echo "Running"
> }
> declare -fx myfunc
> declare -p -F | grep myfunc
> wooledg:~$ source ./foo
> declare -fx myfunc
> wooledg:~$ bash -c myfunc
> Running
> 
> On my system, I see the output from "declare -p -F" upon sourcing the
> file, and the function is definitely exported.  I get the same results
> using Debian's bash 4.4(.12) as well.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: declare(1) not executing inside source'd script Frank <sales@eec.com> - 2018-07-27 11:28 -0400

csiph-web