📄 makedict.sh
字号:
#!/bin/bash# makedict.sh [make dictionary]# Modification of /usr/sbin/mkdict script.# Original script copyright 1993, by Alec Muffett.## This modified script included in this document in a manner#+ consistent with the "LICENSE" document of the "Crack" package#+ that the original script is a part of.# 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 lexicographic research.E_BADARGS=65if [ ! -r "$1" ] # Need at least onethen #+ valid file argument. echo "Usage: $0 files-to-process" exit $E_BADARGSfi # SORT="sort" # No longer necessary to define options #+ to sort. Changed from original script.cat $* | # Contents of specified files to stdout. tr A-Z a-z | # Convert to lowercase. tr ' ' '\012' | # New: change spaces to newlines.# tr -cd '\012[a-z][0-9]' | # Get rid of everything non-alphanumeric #+ (original script). tr -c '\012a-z' '\012' | # Rather than deleting #+ now change non-alpha to newlines. sort | # $SORT options unnecessary now. uniq | # Remove duplicates. grep -v '^#' | # Delete lines beginning with a hashmark. grep -v '^$' # Delete blank lines.exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -