[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Typo in shell substitution example in autoconf manual.
From: |
Nick Bowler |
Subject: |
Typo in shell substitution example in autoconf manual. |
Date: |
Fri, 16 Sep 2011 15:22:51 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello,
I was reading the portability section of the autoconf manual and I
believe there's an error in one of the examples in §11.6: Shell
Substitutions.
https://www.gnu.org/software/autoconf/manual/autoconf.html#Shell-Substitutions
The examples in question are found at the end of the subheading
${var+value}, quoted here:
> Perhaps the easiest way to work around quoting issues in a manner
> portable to all shells is to place the results in a temporary variable,
> then use ‘$t’ as the value, rather than trying to inline the expression
> needing quoting.
>
> $ /bin/sh -c 't="a b\"'\''}\\"; echo "${a-$t}"'
> b c"'}\
> $ ksh -c 't="a b\"'\''}\\"; echo "${a-$t}"'
> b c"'}\
> $ bash -c 't="a b\"'\''}\\"; echo "${a-$t}"'
> b c"'}\
I had a double take upon reading this. I think the output for all three
of those example commands should read
a b"'}\
rather than
b c"'}\
as it appears in the manual.
Cheers,
--
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
- Typo in shell substitution example in autoconf manual.,
Nick Bowler <=