bonzini <paolo.bonzini@xxxxxxxxx> writes: > bash reports a $LINENO relative to the start of the function inside > shell functions. That bug is fixed in Bash 2.05b, released 2002-07-17. The bug is also present in ksh M-11/16/88i (still quite popular, e.g., it's /bin/ksh on Solaris 9), but was fixed some time before M-12/28/93d came out. The bug is not present in PD KSH v5.2.14 99/07/13.2. > 1) revert to the old __oline__ mechanism that was used in autoconf > 2.13 (not very aesthetic) > > 2) always use configure.lineno (slow) > > 3) implement __oline__ in m4 2.0, and rever to configure.lineno when > configure scripts are created with an older m4 (who knows the timeline > for m4 2.0 and libtool 1.6, on which m4 depends?). > > What's the best one? How about the following possibilities as well? 4) Don't use $LINENO inside shell functions that we write, and warn users that $LINENO isn't portable when used inside shell functions. 5) Dynamically test whether $LINENO is working inside shell functions, and prepend the function name to $LINENO if the bug is present. 6) Go ahead and use $LINENO within shell functions, but warn users that the line numbers will be bogus in older shells. 7) Rewrite the code to prefer a shell that supports both shell functions and proper LINENO (e.g., bash 2.05b, ksh93) to a shell that doesn't. Personally I'd prefer (6) + (7).