3 #=======================================================================
5 # File ID: eeac3f34-031b-11e5-aec1-2330d30b8995
7 # Read filenames or paths from stdin and output a list of used
8 # extensions, sorted by frequency.
10 # Author: Øyvind A. Holm <sunny@sunbase.org>
11 # License: GNU General Public License version 2 or later.
12 #=======================================================================
14 progname
=list-extensions
28 " -n "$progname" -- "$@
")"
29 test "$?" = "0" ||
exit 1
38 -h|
--help) opt_help
=1; shift ;;
39 -i|
--ignore-case) opt_ignore_case
=1; shift ;;
40 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
41 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
42 --version) echo $progname $VERSION; exit 0 ;;
44 *) echo $progname: Internal error
>&2; exit 1 ;;
47 opt_verbose
=$
(($opt_verbose - $opt_quiet))
49 if test "$opt_help" = "1"; then
50 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
53 Read filenames or paths from stdin and output a list of used extensions,
56 Usage: $progname [options]
63 Convert all A-Z to a-z before sort and count.
65 Be more quiet. Can be repeated to increase silence.
67 Increase level of verbosity. Can be repeated.
69 Print version information.
75 if test "$opt_ignore_case" = "1"; then
81 perl
-pe 's/^.*\/(.+?)$/$1/' |