5.2. Brief Introduction to Portable sh

If you read a number of 'configure.in's, you will quickly notice that they tend to be written in an unusual style. You will notice, for instance, that you hardly ever see the '[' program used; instead you will see 'test' invoked. We won't go into all the details of writing a portable shell script here; instead, we leave that for Chapter 21, "Writing Portable Bourne Shell."

Like other aspects of portability, the approach you take to writing shell scripts in 'configure.in' and 'Makefile.am' should depend on your goals. Some platforms have notoriously broken sh implementations. For instance, Ultrix sh doesn't implement unset. Of course, the GNU Autotools are written in the most portable style possible, so as ...

Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.