#!/usr/app/TurboShell/bin/bash
set -euo pipefail
# A work folder that is gone at the end, also after an error
work=$(mktemp -d "$PWD/work.XXXXXX")
trap 'rm -rf "$work"; echo "cleaned up"' EXIT

sort -u words.txt >"$work/sorted.txt"
echo "$(wc -l <"$work/sorted.txt") lines in the work folder"
