autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Portability problems of "Usual Tools" not described in manual


From: Russ Allbery
Subject: Portability problems of "Usual Tools" not described in manual
Date: Thu, 12 Mar 2009 21:32:11 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

(This is Debian bug http://bugs.debian.org/466990 against the autoconf-doc
Debian package.)

Attached is a bug report from a Debian user that notes some additional
shell portability issues that aren't included in the Autoconf 2.63
documentation.  (I have not personally verified the reported behavior.)

I'd appreciate it if you would cc address@hidden on
replies so that the reply will also be added to the Debian bug.  Thanks!

--- Begin Message --- Subject: autoconf-doc: Portability problems of "Usual Tools" not described in manual Date: Fri, 22 Feb 2008 11:05:35 +0100 User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
Package: autoconf-doc
Version: 2.59-2
Severity: minor

While working on a larger shell script that has portability requirements,
I came across the following portability issues not described in the
Autoconf manual:

1. sed behaves entirely unpredictable on lines that are not newline-terminated.
   Some implementations pass the line through unchanged, some append a newline,
   some do not print the line at all:

   On GNU/Linux:

     bash-3.1$ echo -n foo | sed -n p
     foobash-3.1$

   On SUN Solaris 2.10:

     bash-3.1$ echo -n foo | sed -n p
     bash-3.1$

   On AIX 6.1:

     bash-3.1$ echo -n foo | sed -n p
     foo
     bash-3.1$

   This does not only hold for the "p" command, but also for (seemingly) all
   others.

2. On HP-UX 11.23, regexp matching with expr does not allow multiple sub-
   expressions:

     bash-3.1$ expr 'Xfoo' : 'X\(f\(oo\)*\)$'
     expr: More than one '\(' was used.

   On most other OSs the result is as expected:

     bash-3.1$ expr 'Xfoo' : 'X\(f\(oo\)*\)$'
     foo

3. On GNU/Linux the regexp "$", when used with older versions of expr,
   matches newlines embedded in the match string:

     bash-3.1$ baz='foo
     > bar'
     bash-3.1$ expr "X$baz" : 'X\(foo\)$' || echo baz
     foo

   On most other OSs and on recent versions of GNU expr the result is as
   expected:

     bash-3.1$ expr "X$baz" : 'X\(foo\)$' || echo baz

     baz

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.11-5
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

-- no debconf information

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]