[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-5.1.3 released: bug-fix-only, candidate for stable 5.2.0
From: |
Paul Eggert |
Subject: |
Re: coreutils-5.1.3 released: bug-fix-only, candidate for stable 5.2.0 |
Date: |
11 Feb 2004 12:33:52 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Jim Meyering <address@hidden> writes:
> I've never heard of a shell performing the // -> / substitution
> indiscriminately.
Me neither.
Autoconf is littered with code like this:
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`echo "$ac_i" | sed "$ac_script"`
This passes an argument with two trailing slashes to 'sed'.
Does it misbehave too, under OSF/Tru64 5.1?
Does any Tru64 expert know whether this bug has been fixed in later
versions, (e.g., Tru64 5.1A) and/or whether it was present in earlier
versions (e.g., Tru64 5.0A or 4.0G)? Is a patch available for Tru64
5.1?
The bug seems to be pretty fundamental; I'm not sure it's worth coding
around. But if it is, then here's a proposed patch to the autoconf
manual.
--- autoconf.texi.~1.801.~ Mon Feb 9 10:31:16 2004
+++ autoconf.texi Wed Feb 11 12:30:19 2004
@@ -9207,6 +9207,7 @@ There are other sources of documentation
* Shell Substitutions:: Variable and command expansions
* Assignments:: Varying side effects of assignments
* Parentheses:: Parentheses in shell scripts
+* Slashes:: Slashes in shell scripts
* Special Shell Variables:: Variables you should not change
* Limitations of Builtins:: Portable use of not so portable /bin/sh
* Limitations of Usual Tools:: Portable use of portable tools
@@ -9974,6 +9975,26 @@ esac
@noindent
but the @code{(} in this example is not portable to many older Bourne
shell implementations. It can be omitted safely.
+
address@hidden Slashes
address@hidden Slashes in Shell Scripts
address@hidden Shell slashes
+
+Beware of command-line arguments containing two or more trailing
+slashes, as Tru64 5.1 @command{sh} omits the last slash in that case:
+
address@hidden
+$ echo / // /// //// .// //.
+/ / // /// ./ //.
+$ x=//
+$ eval "echo \$x"
+/
+$ set -x
+$ echo abc | tr -t ab //
++ echo abc
++ tr -t ab /
+/bc
address@hidden example
@node Special Shell Variables
@section Special Shell Variables
- Re: coreutils-5.1.3 released: bug-fix-only, candidate for stable 5.2.0,
Paul Eggert <=