Portability problems of "Usual Tools" not described in manual

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

 



(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 466990-forwarded@xxxxxxxxxxxxxxx on
replies so that the reply will also be added to the Debian bug.  Thanks!

--- Begin Message ---
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 ---
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux