Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 10 Jun 2012 15:31:27 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Bash completion for older bash versions...

I tried to test bash completion on an older bash version than the one I
have on my Fedora 16 systems (version 4.2.28).

Owl 3.0 is using bash version 3.1.17.
So I downloaded the compressed iso image, and booted it on my laptop.

Unfortunately, there seems to be no command specific bash completion
included.

# complete -p

(no output at all)

/etc/bash_completion doesn't exist, neither the directory
/etc/bash_completion.d

The oldest other distribution I got hold of was a Fedora 14, using bash
version 4.1.7.

So I tested bash completion on this system.

sourcing john.bash_completion resulted in an error message:
syntax error near unexpected token '('
complaining about -?(-)...
I use this to support completion for abbreviated option names, e.g.,
-inc= or -inc: instead of --incremental=.

$ shopt -s extglob fixed that problem.

I wouldn't want to add this statement at the beginning of my bash
completion script, because that would change general bash behavior, not
just bash completion for john.

I could add
shopt -p extglob
at the begin of my script, and check whether the output is
shopt -s extglob
or
shopt -u extglob
and only define the bash completion functions and process the
complete -F _john john
statement when the extended pattern matching features are enabled.

Nevertheless, after
$ shopt -s extglob fixed that.
I could source john.bash_completion without any syntax errors.

But trying to use it by pressing [tab] on the command line resulted in
bash: _get_comp_words_by_ref: command not found...

Unfortunately, I cannot test whether this could have been fixed by
installing an additional package for bash completion, because Fedora
14's end of life has been long ago.

$ complete -p
just lists

complete -o filenames -F __udisks udisks

So this doesn't look like command specific bash completion is enabled.
The bash completion for udisks (file
/etc/profile.d/udisks-bash-completion.sh) was part of of the udisks rpm
package.

Any ideas how to further test bash completion for older systems, and how
to handle the shopt -u extglob case (except pointing out in the
documentation (doc/README.bash-completion) that shopt -s extglob is
required to use bash completion?

Is anybody able to test bash completion for john on a system with bash
version <= 4, so that I find out what needs to be fixed there.
Or is trying to support older bash versions too hard.
Are there other Linux distributions or other operating systems still
using bash versions < 4?


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.