Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 7 Sep 2012 00:23:17 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: bash completion on OSX

On 6 Sep, 2012, at 21:21 , Frank Dittrich <frank_dittrich@...mail.com> wrote:

> On 09/06/2012 09:35 AM, magnum wrote:
>> On 6 Sep, 2012, at 7:50 , Frank Dittrich <frank_dittrich@...mail.com> wrote:
>>> Can you test if bash's syntax check complains about
>>> --restore|--status)
>>> as well (if you comment out or delete the
>>> -?(-)f?(o|or|orm|orma|ormat)+(=|:)*)
>>> and subsequent lines?
>> 
>> bash: _get_comp_words_by_ref: command not found
> 
> _get_comp_words_by_ref should be defined in /etc/bash_completion.
> Since this error disappeared when you installed bash completion for git,
> I'll currently not spend time investigating this problem any further.

Yeah, I probably just commented out too much or too little.

>> sed: 1: "{ s#^ *\(--[a-z-]*=\?\( ...": bad flag in substitute command: '}'
>> 
>> This error is run-time (happens when I press TAB). Actually, I now enabled git completion which apparently in turn enables globbing. After that, sourcing the pristine john completion file works fine, but I now get a similar run-time error:
...
> If OSX has a problem here, that suggests the sed command  implementaion
> used for OSX is not POSIX compatible, or GNU sed has a bug (not
> disabling all GNU extensions when using sed --posix).
> 
> For the first of the two sed commands mentioned above, I can easily get
> rid of { and }.
> 
> To get rid of the ';', I had to split the sed scripts into several
> scripts per command.
> 
> I tested my changes with and without defining
> alias sed='sed --posix'
> 
> So the attached patch should work. (I also improved the grammar of the
> comment regarding extended pattern matching.)

Thanks! Now it works. I also modded the makefile target for bash completion: Since we cannot use the environment variables pointing out the target directory (I still don't get why, it is supposed to work), we copy to any (all) *present* bash_completion.d directories in /etc, /usr/local/etc and /opt/local/etc. Unfortunately this also meant we will copy it regardless of if it's updated or not. Not a big deal.

magnum


Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ