instant-data-scraper-utils/bin/unify.sh

16 lines
329 B
Bash
Executable file

#!/usr/bin/env bash
# This script is to help make combining lists of things quick and easy, and
# quite dirty.
_target="$1"
# Lowercase all text
sed -i 's/.*/\L&/' "${_target}"
# Remove trailing spaces.
sed -i 's/[[:space:]]*$//' "${_target}"
sort "${_target}" | uniq > "${_target}.tmp" && mv "${_target}.tmp" "${_target}"