Enrique Perez-Terron wrote:
> I am unable to make sense of the bash man-page description of the
> extquote shopt option.
> 
> It says:
> 
>   extquote
>    If set, $’string’ and $"string" quoting is performed within
>    ${parameter} expansions enclosed in double quotes.  This option
>    is enabled by default.
> 
> Can anybody come up with an example where the setting of extquote
> makes a difference?   I would actually like to have two examples,
> one with $'string' and one with $"string".

Sure.  Run the following:

shopt -u extquote

echo "${v:-$"translate me"}"
echo "${v:-$'ab\ncd'}"

shopt -s extquote

echo "${v:-$"translate me"}"
echo "${v:-$'ab\ncd'}"

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live Strong.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to