From 6e2757111ca57e52f36369f9fdc5c8889f2eeafd Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 4 Apr 2012 16:26:08 -0400 Subject: [PATCH] support adding words on the cmdline --- .bin/aspell-sort-pws | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.bin/aspell-sort-pws b/.bin/aspell-sort-pws index 36a1286..e95d6ae 100755 --- a/.bin/aspell-sort-pws +++ b/.bin/aspell-sort-pws @@ -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 -- 2.39.5