#!/bin/sh usage() { cat 1>&2 <&2 exit 1 fi attr="((Local|Global|Program|Canonical)[[:space:]]+)" deprable="Theorem|Lemma|Fact|Corollary|Proposition|Property|\ Definition|Example|Fixpoint|\ Instance|Axiom|Parameter|Notation|Coercion" annot="#[deprecated(since=\"$vers\", note=\"$note\")]" tmp="$file".depr sed -E "s/(^[[:space:]]*)(($attr)*($deprable).*\$)/\\1$annot\\n\\1\\2/" \ "$file" >"$tmp" mv "$tmp" "$file"