/bin/sh: line 2: `BASH_FUNC_ttr%%': not a valid identifier

Brandon Allbery allbery.b at gmail.com
Fri Oct 10 07:27:34 PDT 2014


On Fri, Oct 10, 2014 at 10:07 AM, Barrie Stott <zen146410 at zen.co.uk> wrote:
>
> Where is this Debian/FreeBSD patch? What is it patching? Are there
> instructions for its use?
>

https://svnweb.freebsd.org/ports/head/shells/bash/files/extrapatch-import-functions?revision=369467&view=markup
It's a patch to bash to only import functions in interactive shells or when
explicitly enabled. (The previous version disabled it unconditionally; the
current one enables in interactive shells.)
I personally would prefer we adopt this patch.

Unfortunately it appears to have been revised; the original version didn't
automatically enable it in interactive shells, and doing so pretty much
brings back the same incompatibility with unpatched bash. Worse, the older
revision won't apply to an up to date bash, as the prefix and suffix code
added afterward is not present in the patch's context. That said, a simple
edit after patching would fix it:

    if (!import_functions && !interactive_shell) {

should become

if (!import_functions) {

# # #

That said, 10.6 being unsupported by Apple, it is possible that your best
bet is to copy /bin/bash to /bin/bash.apple and then copy MacPorts' bash to
/bin/bash. (But beware, if you remove MacPorts in the future your /bin/bash
will break; copy the saved one back first.)

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20141010/605a102e/attachment.html>


More information about the macports-users mailing list