Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 9 Sep 2012 19:55:18 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: bash completion on OSX

On 7 Sep, 2012, at 0:23 , magnum <john.magnum@...hmail.com> wrote:

> On 6 Sep, 2012, at 21:21 , Frank Dittrich <frank_dittrich@...mail.com> wrote:
> 
>> 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.

It works, but not quite everything works. Rules completion and External mode completion works fine. Options completion (john --[TAB]) works fine.

But this does not work:

$ john -fo:[TAB]
sed: 1: "p }
": extra characters at the end of p command

Instead of bugging you with OSX quirks (although it would be nice if we eventually get it generic enough), I first tried installed gnu sed from macports but this did not fix it. Instead, it now is totally quiet. I press TAB after "-fo:" and absolutely nothing happens.

I tried manually running what is in the script (with gnu sed):
../run/john | sed -n -e '/^--format/,$ {' -e 's#^--format=[ A-Za-z]*:##' -e '/^--/ b' -e 's#^ *##' -e 's#\<dynamic_n\>#dynamic#' -e 's#^\(.*\)$#\L\1#' -e 's#[/ ]#\n#g' -e 'p }'

...and I do get the format list. I have no idea why it does not show up in completion.

Worst of all, I think it worked for a while without me even installing gnu sed. But I am too unstructured to really know for sure %-)

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.