From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21552 invoked by alias); 30 Aug 2016 13:34:16 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 21538 invoked by uid 89); 30 Aug 2016 13:34:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=Nellis, nellis, Hx-languages-length:1685, H*f:sk:1814462 X-HELO: USA7109MR002.ACS-INC.COM Received: from usa7109mr002.acs-inc.com (HELO USA7109MR002.ACS-INC.COM) (13.28.230.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Aug 2016 13:34:10 +0000 Received: from usa7109ht002.na.xerox.net ([13.41.230.32]) by USA7109MR002.ACS-INC.COM with ESMTP/TLS/AES128-SHA256; 30 Aug 2016 08:34:08 -0500 Received: from USA7109MB022.na.xerox.net ([169.254.6.230]) by USA7109HT002.na.xerox.net ([13.41.230.32]) with mapi id 14.03.0294.000; Tue, 30 Aug 2016 08:34:08 -0500 From: "Nellis, Kenneth" To: "cygwin@cygwin.com" Subject: RE: bash: igncr shell option breaks my PS1 prompt Date: Tue, 30 Aug 2016 16:57:00 -0000 Message-ID: <0D835E9B9CD07F40A48423F80D3B5A704BB92AEC@USA7109MB022.na.xerox.net> References: <181446230.20160830061415@yandex.ru> In-Reply-To: <181446230.20160830061415@yandex.ru> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2016-08/txt/msg00603.txt.bz2 From: Andrey Repin=20 >=20 > Greetings, Eric Blake! >=20 > > But it seems like \n handling in PS1 is independent of any change in > > handing in the 'read' builtin. As evidence, I ran the following test > > using the older bash-4.3.42-4 build: >=20 > > $ bash-4.3.42-4 > > $ set -o igncr > > $ PS1=3D'$(date)\n# ' > > bash: command substitution: line 1: syntax error near unexpected token > ')' > > bash: command substitution: line 1: `date)' >=20 > That's interesting. >=20 > I've just tried it on Linux. >=20 > $ PS1=3D'$(date)\n\$ ' > Tue Aug 30 06:10:48 MSK 2016 > $ bash --version > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) >=20 > (No idea why they ship this ancient version...) > And on Cygwin >=20 > $ PS1=3D'$(date)\n\$ ' > Tue Aug 30 06:12:38 MSK 2016 > $ bash --version > GNU bash, version 4.3.46(6)-release (x86_64-unknown-cygwin) > $ set -o igncr > -bash: command substitution: line 1: syntax error near unexpected token > `)' > -bash: command substitution: line 1: `date)' >=20 > > $ exit >=20 > > So you have uncovered a latent problem, unrelated to the recent igncr > > fixes, but which is indeed tied to the overall igncr patches, and which > > you had no reason to trip over until the igncr change to 'read' changed > > your desire to use igncr. >=20 > Seems like it is related, at least in some way. But, get this: $ PS1=3D'$(date)\n\$ ' Tue Aug 30 09:30:37 EDT 2016 $ set -o igncr -bash: command substitution: line 1: syntax error near unexpected token `)' -bash: command substitution: line 1: `date)' $ PS1=3D'`date`\n\$ ' Tue Aug 30 09:31:01 EDT 2016 $ So, the $() syntax is part of the mix. Use back-ticks as a workaround. --Ken Nellis -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple