Hi Keith, * Keith MARSHALL wrote on Mon, Oct 24, 2005 at 04:09:45PM CEST: > Ralf Wildenhues wrote, quoting me: > >> Why would anyone want to do so anyway? If I want to write a shell > >> script, other than as a configure script, it's *much* more logical > >> and convenient for me to just write directly as such, in the shell's > >> own native language. > > > > Those who don't use M4SH_INIT are doomed to reinvent it, painfully. > > Oh yeah? And M4SH_INIT is sooooo well documented, that everyone will > rush to use it! I already agreed with you that the documentation is bad or not present in some cases, and that this is a bad situation. And I encouraged you to improve upon it. :) > Granted, these considerations will extend beyond autoconf, into the > other autotools, but the point I was trying to make is that, for > everyday shell scripting needs, using m4 to generate the script is > just more trouble than it's worth. Granted, too. I don't use it either for scripts which have limited use or may assume a "sane" or even POSIX shell already. All I was trying to say: it may be useful in order to be able to forget about a few possible issues. > Consider the pdfroff script in groff: > > http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/pdfmark/pdfroff.sh?rev=1.7&content-type=text/vnd.viewcvs-markup > > That was written from scratch, with nary a sniff of m4, and it runs > portably, on a wide variety of platforms. To quote from it: | # Establish how to invoke 'echo', suppressing the terminating newline. | # (Adapted from 'autoconf' code, as found in 'configure' scripts). | # | case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in | *c*,*-n*) n='' c='' ;; | *c*) n='-n' c='' ;; | *) n='' c='\c' ;; | esac Autoconf's M4SH_INIT is merely a collection of those little snippets, so you don't have to go back to looking at 'configure' scripts, or updating it in case bugs are found. And by the way: there was some time ago (2005-02-23) a patch against this very code snippet because it was suboptimal in some situation. The change might or might not be useful for your script, I haven't checked. C'mon Keith, you won't argue that a central place to put stuff like this is a bad idea per se. The only other thing you seem to disagree on is the use of m4 for this. Well, I'm not so overly fond of that, either, but do not care very much. And with Autoconf being built upon m4, it seems the natural choice there. Cheers, Ralf _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf