bug-groff
[Top][All Lists]
Advanced

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

if-else \{\ ... \} docs contain broken example (groff 1.21)


From: Jim Avera
Subject: if-else \{\ ... \} docs contain broken example (groff 1.21)
Date: Wed, 13 Feb 2013 08:38:00 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

# The groff 1.21 'info' documentation for if-else \{\ ... \} contains an
# example which is incorrect.  To see the example, run "info make"
# and type /Escape: \\\{
#
# Here it is:
#
# [begin quote]
# -- Escape: \{
# -- Escape: \}
#     In many cases, an if (or if-else) construct needs to execute more
#     than one request.  This can be done using the `\{' and `\}'
#     escapes.  The following example shows the possible ways to use
#     these escapes (note the position of the opening and closing
#     braces).
#
#          .ie t \{\
#          .    ds lq ``
#          .    ds rq ''
#          .\}
#          .el \
#          .\{\
#          .    ds lq "
#          .    ds rq "\}
#
# [endquote]
#
# The above code doesn't work because the double-quotes in the else
# clause introduce literal strings.  Running it under nroff produces
# a run-time error and does not set lq and rq correctly, and the \} is not recognized.

nroff  >/dev/null <<'EOF'
.ie t \{\
.    ds lq ``
.    ds rq ''
.\}
.el \
.\{\
.    ds lq "
.    ds rq "\}
.
.tm RESULT: lq=\*(lq rq=\*(rq
EOF
# <standard input>:6: name expected (got `\{'): treated as missing
# RESULT: lq= rq=\}

Attachment: groffbug.sh
Description: application/shellscript


reply via email to

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