X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/c5700d5c465c80b8696ec487830099163b9eba64..b93242d984f05a0c15b59864b2e0e007543c65b0:/unitproc/find_erotica.sh?ds=sidebyside diff --git a/unitproc/find_erotica.sh b/unitproc/find_erotica.sh index 3fd8b22..4b073b9 100755 --- a/unitproc/find_erotica.sh +++ b/unitproc/find_erotica.sh @@ -2,7 +2,7 @@ # Desc: Searches for erotic phrases in text files in specified working directory # Usage: find_erotica.sh [dir] # Depends: GNU Find utils, GNU Parallel 20210822, GNU Grep, GNU Coreutils 8.32, bc -# Version: 0.2.2 +# Version: 0.4.0 FIN_MAX=400; @@ -69,6 +69,7 @@ find_nouns() { cmd+=('-e' 'nipple'); cmd+=('-e' 'areola'); cmd+=('-e' 'breast'); + cmd+=('-e' 'vulva'); cmd+=('-e' 'womanhood'); cmd+=('-e' 'manhood'); cmd+=('-e' 'his member'); @@ -281,10 +282,13 @@ find_phrase () { #printf "Found %d matching lines for phrases in %s.\n" "${#output[@]}" "$fin" 1>&2; # debug }; # find phrase main () { - din="$1"; - if [[ ! -d "$din" ]]; then die "FATAL:Not a dir:${din}"; fi; + # Check args are dirs + local item; + for item in "$@"; do + if [[ ! -d "$item" ]]; then die "FATAL:Not a dir:${din}"; fi; + done; - find "$din" -type f -name "*.txt" | shuf | head -n "$FIN_MAX" | \ + find "$@" -type f -name "*.txt" | shuf | head -n "$FIN_MAX" | \ #parallel search_thread '{}' | less --RAW-CONTROL-CHARS -S; parallel search_thread '{}'; };