combination of Awk and sed to replace $LINENO.
+2001-10-04 Akim Demaille <akim@epita.fr>
+
+ * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Use a portable
+ combination of Awk and sed to replace $LINENO.
+
2001-10-02 Paul Eggert <eggert@twinsun.com>
* doc/autoconf.texi (Limitations of Builtins): You can't use
!= x$as_me.lineno; then
# Be sure to write the pattern so that it doesn't replace itself:
# it must not match itself.
- awk '{
- if ($[0] ~ /[[$]]LINENO/)
- while (sub (/[[$]]LINENO/, NR))
- continue
- print
- }' <$as_myself >$as_me.lineno
+ awk <$as_myself '
+ /[[$]]LINENO/ { printf "%d:", NR }
+ { print }
+ ' |
+ sed ['/[$]LINENO/s/^\([0-9][0-9]*\):\(.*\)[$]LINENO/\2\1/'] \
+ >$as_me.lineno
chmod +x $as_me.lineno
fi