Klasyczny skrypt z 1993. Autorem skryptu jest Alec Muffett. „This script processes text files to produce a sorted list of words found in the files. This may be useful for compiling dictionaries and for other lexicographic purposes.” Niestety, ten skrypt nie rozpoznaje polskich liter: ą, ć, ę, itd.
#!/bin/bash
E_BADARGS=64
if [ ! -r "$1" ] # Need at least one
then # valid file argument.
echo "Usage: $0 files-to-process"
exit $E_BADARGS
fi
cat $* | # Contents of specified files to stdout.
tr A-Z a-z | # Convert to lowercase.
tr ' ' '\012' | # New: change spaces to newlines.
tr -c '\012a-z' '\012' | # Rather than deleting non-alpha chars,
# change them to newlines.
sort | #
uniq | # Remove duplicates.
grep -v '^#' | # Delete lines beginning with a hashmark.
grep -v '^$' # Delete blank lines.
exit 0
Potrzeba mi jest pilnie, pomoc. Otoz tak jak napisno wyzej skrypt ten nie rozpoznaje polskich znakow, a moj znajomy ma za zadanie przerobic go tak by je rozpoznawal i dodatkowo jakos krotko go opisac (w kilku zdaniach). Jezeli jakis bashowy geniusz z NW bylby w stanie to zrobic to bylbym super wdzieczny
fotka http://tiny.pl/hmgdt
