Someone
public text v1 · immutable#!/bin/bash
BINDIR=$(dirname "$0")
[ $# -ne 0 ] && { echo "Usage: $0"; exit 1; }
IFS=''
find . -mindepth 1 -printf "%P\n" \
| while read f; do
if [[ "$f" =~ "\.talk$" ]]; then
if [[ ! "$f" =~ "(^|/)_dirname.talk$"
&& ! -f "${f%.talk}" ]]; then
# presumably a file was deleted and the .talk clip left behind.
echo "Removing unnecessary talk clip $f"
rm "$f"
fi
else
${BINDIR}/mkdottalk "$f"
fi
done