]> git.wh0rd.org Git - home.git/commitdiff
support adding words on the cmdline
authorMike Frysinger <vapier@gentoo.org>
Wed, 4 Apr 2012 20:26:08 +0000 (16:26 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Apr 2012 19:36:46 +0000 (15:36 -0400)
.bin/aspell-sort-pws

index 36a12861f3136afc3183159ac356ab3ceabe5b97..e95d6aef27e7c534e2fa1c580922677e86ac5a00 100755 (executable)
@@ -2,10 +2,13 @@
 set -ex
 cd ~/
 file=".aspell.en.pws"
-header=$(head -1 ${file})
-sed 1d ${file} | LC_ALL=en_US sort > ${file}.tmp
+header=$(head -1 ${file} | sed 's: [0-9]* *$::')
 (
-echo ${header}
+sed 1d ${file}
+printf '%s\n' "$@"
+) | LC_ALL=en_US sort -u | sed '/^[[:space:]]*$/d' > ${file}.tmp
+(
+echo "${header} $(wc -l ${file}.tmp | awk '{print $1}') "
 cat ${file}.tmp
 ) > ${file}
 rm ${file}.tmp