Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Xin Wu Newsgroups: gnu.bash.bug Subject: possible bug in Bash 5.0 Date: Wed, 25 Dec 2019 23:41:38 +0100 Lines: 28 Approved: bug-bash@gnu.org Message-ID: References: <482a982b-c02b-65a3-68c5-e4c0e1f62874@uni-paderborn.de> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1577325995 9390 209.51.188.17 (26 Dec 2019 02:06:35 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QwstjDuLSZ10ZtQpQrNGNNjgaD5j9hHPuBWkARRCe9Q=; b=RSMop59gquVbaBJNOtEztF4xrY a5cpoeeDo5eFewI0PVvM1JEmHf9UehZmlV+ZbxkgtbQOjN4u5hKAsunGBQiTDPMygPeimnxSTorTJ HmBaLaKpAW8424zLZ0/XNZgyJorg6F1k9ybkZNY0qBSmztk225nc0oQP2n4XU+U1+zE8=; User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 Content-Language: en-US X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.8.2820816, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.12.25.223617, AntiVirus-Engine: 5.68.0, AntiVirus-Data: 2019.11.20.5680001 X-IMT-Authenticated-Sender: uid=xinwu,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:638:502:c003::14 X-Mailman-Approved-At: Wed, 25 Dec 2019 21:06:33 -0500 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <482a982b-c02b-65a3-68c5-e4c0e1f62874@uni-paderborn.de> Xref: csiph.com gnu.bash.bug:15780 Hi, I found the single-bracket [ ... ] and double-bracket [[ ... ]] behave differently for string comparison in the follow simple Bash-script. # comma (,) is before two (2) in ASCII a=,rst b=2rst if [ "$a" \> "$b" ]; then echo "single-bracket" fi if [[ "$a" > "$b" ]]; then echo "double-bracket" fi According to some web pages I was expecting that single-bracket and double-bracket should give same result. I'm not a Bash-expert, therefore I'm not sure whether this is a real bug in Bash 5.0. Merry Christmas! Xin PS: the web pages are: * http://tldp.org/LDP/abs/html/comparison-ops.html * http://tldp.org/LDP/abs/html/refcards.html * http://mywiki.wooledge.org/BashFAQ/031