bug-bash
[Top][All Lists]
Advanced

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

Escape newline within quotes in commands


From: Werner Fink
Subject: Escape newline within quotes in commands
Date: Wed, 01 Mar 2006 16:25:48 +0100
User-agent: nail 11.4 8/29/04

                             BASH PATCH REPORT
                             =================

Bash-Release: 3.1.5
Bug-Description:

Lines like

   g31:bash-3.0 > x=`echo A B C | sed 's/ /\\
   > /g'` 
   g31:bash-3.0 > echo "$x"
   A
   B
   C

do not work with current bash 3.1.5.  This breaks
scripts working with both the pdksh/ksh and the
old bash 3.0.  The enclosed patch restore the old
behaviour.

Patch:

*** parse.y
--- parse.y     Wed Mar  1 14:49:59 2006
***************
*** 2898,2904 ****
        }
        else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 
0)
        {
!         nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags);
          goto add_nestret;
        }
        else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '['))     
/* ) } ] */
--- 2898,2907 ----
        }
        else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 
0)
        {
!         if (ch == '\'')
!           nestret = parse_matched_pair (0, ch, ch, &nestlen, 
P_ALLOWESC|rflags);
!         else
!           nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags);
          goto add_nestret;
        }
        else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '['))     
/* ) } ] */




reply via email to

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