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" 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: 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 To: bug-bash 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11281 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,