lib/Tools/update_sub_sup
changeset 52618 2077168aa8f7
child 52921 0ea2b657eb42
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/Tools/update_sub_sup	Fri Jul 12 14:54:17 2013 +0200
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+#
+# Author: Makarius
+#
+# DESCRIPTION: update sub/sup control symbols
+
+
+## diagnostics
+
+PRG="$(basename "$0")"
+
+function usage()
+{
+  echo
+  echo "Usage: isabelle $PRG [FILES|DIRS...]"
+  echo
+  echo "  Recursively find .thy/.ML files and update control symbols for"
+  echo "  sub- and superscript."
+  echo
+  echo "  Old versions of files are preserved by appending \"~~\"."
+  echo
+  exit 1
+}
+
+
+## process command line
+
+[ "$#" -eq 0 -o "$1" = "-?" ] && usage
+
+SPECS="$@"; shift "$#"
+
+
+## main
+
+find $SPECS \( -name \*.ML -o -name \*.thy \) -print0 | \
+  xargs -0 "$ISABELLE_HOME/lib/scripts/update_sub_sup"