All pastes #923066 Raw Edit

Someone

public text v1 · immutable
#923066 ·published 2008-02-29 06:40 UTC
rendered paste body
#!/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