Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 9 May 2012 19:57:24 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Fwd: bash auto-completion for john

On 05/09/2012 07:36 PM, Aleksey Cherepanov wrote:
> On Wed, May 09, 2012 at 03:39:55PM +0200, Frank Dittrich wrote:
>> But there are many more formats:
>>
>> --format=NAME             force hash type NAME: afs bf bfegg bsdi crc32
>> crypt
> ...
> 
> Yes, it does not work. Because this version of john uses space as a delimiter
> while my code expects slash. That is why I check output manually.

Yes, older versions used a slash as delimiter.

>> In my bash completion script, I use something like
>>
>> ./john|grep -A 100 '^--format='|sed 's#^--format=[ A-Za-z]*:##'|grep -v
>> '^--'|sed 's#^ *##'|sed 's#[/ ]#\n#g'|sed 's#^dynamic_n$#dynamic#'
> 
> I simplified it a bit:
> 
> john | sed -n '/^--format/,$ { s#^--format=[ A-Za-z]*:##; /^--/ q; s#^ *##; s#\<dynamic_n\>#dynamic#; s#[/ ]#\n#g; p }'

Thanks, this looks much better. (Just one sed instead of several sed and
grep commands, no hard coded numbers (though 100 lines of format names
should have been more than enough).

Frank

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.