Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11281

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.ripco.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From "Chris F.A. Johnson" <chris@cfajohnson.com>
Newsgroups gnu.bash.bug
Subject Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)
Date Sun, 2 Aug 2015 17:27:55 -0400 (EDT)
Lines 20
Approved bug-bash@gnu.org
Message-ID <mailman.7769.1438550903.904.bug-bash@gnu.org> (permalink)
References <55BE6FB8.4080200@tlinx.org> <55BE7DD6.3040509@tlinx.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Trace usenet.stanford.edu 1438550903 14122 208.118.235.17 (2 Aug 2015 21:28:23 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Linda Walsh <bash@tlinx.org>
To bug-bash <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a0-2; h=Feedback-ID:X-Smtpcorp-Track:Message-ID:Subject:To: From:Date; bh=nTObkACrzBeK9dI+ijVFtAQluZCh8xqRG7aTEDSm5m0=; b=BsD2ZYPVyhEu//L boWlKJ96CSfOK+W3lQArjYFgsxkm2moMVT76NKHJ5+jbsL888EBbb7+HtjmUDYIar0hN+qJWKie6n xcBeAon4MtaJLCB3QOVSCoat2KkbrbLlt5s23AcghJstFgHDg9E13ogIiEQsUFl3SQuGdUetZ+zWU xgklHXbSpezGlBnNq77WzGF7EN2zODbVDloBa6QyNy+gREqOWkkkofeUCetxgwcP1hVRbpZ8v2Yp+ 9xdMzdq4cyRd8rwrVsiFIcY2cpr1EPzjUeDFa43lGG+nvDEpIJI+BKzFt8zVUrAwbf0xCF1CDEZs7 AF7KyEOuYuIhLPSDqVQ==;
X-X-Sender chris@chris.tor
In-Reply-To <55BE7DD6.3040509@tlinx.org>
User-Agent Alpine 2.10 (DEB 1266 2009-07-14)
X-Smtpcorp-Track 1Zu0nXNRKGhw2W.vptvjcSnf
Feedback-ID 124612m:124612a-vpTX9:124612sVE4IPKw41:SMTPCORP
X-Report-Abuse Please forward a copy of this message, including all headers, to <abuse@smtp2go.com>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 3.x
X-Received-From 216.22.15.234
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.14
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:11281

Show key headers only | View raw


On Sun, 2 Aug 2015, Linda Walsh wrote:

>
> also noticed this similar strange behavior:
>
> used 'ord'** for this test (trying to compare decimal val of chars)
>
> isatty () { test -c /proc/self/fd/1 ; }
> ord () { local nl=""; isatty && nl="\n"; printf "%d$nl" "'$1" ; } ord () { local nl=""; isatty && nl="\n"; printf "%d$nl" "'$1" ; } 
>> ord "$(printf "\n")"

    Trailing newline are stripped from command substitution, making "$(printf "\n")" and empty string.

    If you want a newline, use:

ord $'\n'

-- 
Chris F.A. Johnson, <http://cfajohnson.com>

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release) "Chris F.A. Johnson" <chris@cfajohnson.com> - 2015-08-02 17:27 -0400

csiph-web