#!/usr/bin/env sh # Library {{{ mktmp() { ensure_tmp_dir mktemp -p "$LIB_TEMP_DIR_FOR_SCRIPT" } ensure_tmp_dir() { if ! [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ]; then LIB_TEMP_DIR_FOR_SCRIPT="$(mktemp -d)" export LIB_TEMP_DIR_FOR_SCRIPT fi } remove_tmp_dir() { # The test is here because some scripts still delete this on their own if [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ]; then rm -r "$LIB_TEMP_DIR_FOR_SCRIPT" fi } trap remove_tmp_dir EXIT ensure_tmp_dir # ensure that the variable has been set, even in subshells # }}} tmp="$(mktmp)" curl https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt | awk '!/^#/' | awk '!/^[\s\t]*$/' | awk -v s="'" '!/.*s.*/' | # This entry contains duplicated spaces, just ignore it awk '!/Power/' | iconv -c -f utf-8 -t ascii \ >"$tmp" counter=0 cat <"$tmp2" if rg '^[A-Za-z0-9_.-]+$' "$tmp2" -q; then cat <?!+^@&*~|=,/\\ -]*$' "$tmp2" -q; then cat <