On Sat, Aug 12, 2017 at 09:32:08AM +0100, Sami Kerola wrote: > The WORDLIST is the same hunspell(1) and ispell(1) uses to achieve the same. > Apparently aspell(1) does not work with files like traditional dict lists. > > Reference: https://github.com/hunspell/hunspell/blob/master/man/hunspell.1#L388 > Reference: http://www.skrenta.com/rt/man/ispell.1.html > Reference: http://aspell.net/man-html/Creating-an-Individual-Word-List.html#Creating-an-Individual-Word-List > Signed-off-by: Sami Kerola <kerolasa@xxxxxx> > --- > misc-utils/look.1 | 5 +++++ > misc-utils/look.c | 7 ++++++- > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/misc-utils/look.1 b/misc-utils/look.1 > index 503e38584..cca83416e 100644 > --- a/misc-utils/look.1 > +++ b/misc-utils/look.1 > @@ -101,6 +101,11 @@ sort -d /etc/passwd -o /tmp/look.dict > look -t: root:foobar /tmp/look.dict > .nf > .RE > +.SH ENVIRONMENT > +.TP > +.B WORDLIST > +Path to a dictionary file. The environment variable has greater priority > +than the dictionary path defined in FILES segment. > .SH FILES > .IP "\fB/usr/share/dict/words\fR" 4 > the dictionary > diff --git a/misc-utils/look.c b/misc-utils/look.c > index 60fbbbfca..00061f2a3 100644 > --- a/misc-utils/look.c > +++ b/misc-utils/look.c > @@ -104,7 +104,12 @@ main(int argc, char *argv[]) > > setlocale(LC_ALL, ""); > > - file = _PATH_WORDS; > + if ((file = getenv("WORDLIST"))) { > + if (access(file, R_OK)) > + err(EXIT_FAILURE, "WORDLIST=%s", file); > + } else > + file = _PATH_WORDS; > + Would be better fallback to _PATH_WORDS if WORDLIST= points to nowhere? file = _PATH_WORDS; /* default */ if ((x = getenv("WORDLIST")) && access(file, R_OK) == 0) file = x; seems like more backwardly compatible way. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html