~ubuntu-branches/ubuntu/natty/abs-guide/natty

« back to all changes in this revision

Viewing changes to abs/makedict.sh

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-05-09 17:49:52 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100509174952-1s583w0zbh7rl1po
Tags: 6.2-1
* New upstream release; Closes: #441278
* debian/control
  - adopting package; Closes: #577181
  - removed bzip2 from b-d-i, no more needed
  - debhelper has to be in b-d
  - bump Standards-Version to 3.8.4 (no changes needed)
  - added Homepage field
  - added misc:Depends to Depends
  - added Vcs-{Browser, Git} field
* debian/rules
  - removed the unpacking stuff, we now use an alrqady unpacked source
  - added more example scripts to fix
* debian/{compat, control, rules}
  - switched to debhelper 7
* debian/watch
  - updated to new upstream location; thanks to Raphael Geissert for the
    report; Closes: #453596
* debian/copyright
  - updated with new location and copyright/license notices
* debian/source/format
  - set source package format to 1.0 explicitly
* debian/abs-guide.doc-base
  - set Section field correctly
* debian/{copyright, abs-guide.doc-base}
  - updated upstream email
* debian/abs-guide.lintian-overrides
  - added override for "known syntax-errored" scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
# makedict.sh  [make dictionary]
 
3
 
 
4
# Modification of /usr/sbin/mkdict (/usr/sbin/cracklib-forman) script.
 
5
# Original script copyright 1993, by Alec Muffett.
 
6
#
 
7
#  This modified script included in this document in a manner
 
8
#+ consistent with the "LICENSE" document of the "Crack" package
 
9
#+ that the original script is a part of.
 
10
 
 
11
#  This script processes text files to produce a sorted list
 
12
#+ of words found in the files.
 
13
#  This may be useful for compiling dictionaries
 
14
#+ and for other lexicographic purposes.
 
15
 
 
16
 
 
17
E_BADARGS=65
 
18
 
 
19
if [ ! -r "$1" ]                    #  Need at least one
 
20
then                                #+ valid file argument.
 
21
  echo "Usage: $0 files-to-process"
 
22
  exit $E_BADARGS
 
23
fi  
 
24
 
 
25
 
 
26
# SORT="sort"                       #  No longer necessary to define options
 
27
                                    #+ to sort. Changed from original script.
 
28
 
 
29
cat $* |                            # Contents of specified files to stdout.
 
30
        tr A-Z a-z |                # Convert to lowercase.
 
31
        tr ' ' '\012' |             # New: change spaces to newlines.
 
32
#       tr -cd '\012[a-z][0-9]' |   #  Get rid of everything non-alphanumeric
 
33
                                    #+ (in original script).
 
34
        tr -c '\012a-z'  '\012' |   #  Rather than deleting non-alpha chars,
 
35
                                    #+ change them to newlines.
 
36
        sort |                      # $SORT options unnecessary now.
 
37
        uniq |                      # Remove duplicates.
 
38
        grep -v '^#' |              # Delete lines beginning with a hashmark.
 
39
        grep -v '^$'                # Delete blank lines.
 
40
 
 
41
exit 0