* tests/defs.in (unindent): New subroutine.
+2011-02-16 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ test defs: add subroutine for input unindenting
+ * tests/defs.in (unindent): New subroutine.
+
2011-02-15 Stefano Lattarini <stefano.lattarini@gmail.com>
python: report the 'PYTHON' influential environment variable
AUTOMAKE_run 1 ${1+"$@"}
}
+# unindent [input files...]
+# -------------------------
+# Remove the "proper" amount of leading whitespace from the given files,
+# and output the result on stdout. That amount is determined by looking
+# at the leading whitespace of the first non-blank line in the input
+# files. If no input file is specified, standard input is implied.
+unindent ()
+{
+ cat ${1+"$@"} > deindent.tmp
+ indentation=`sed <deindent.tmp -n "
+ /[^ $tab].*$/{
+ s///p
+ q
+ }"`
+ sed "s/^$indentation//" deindent.tmp
+ rm -f deindent.tmp
+}
+
# Turn on shell traces.
set -x