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


Groups > gnu.bash.bug > #15780 > unrolled thread

possible bug in Bash 5.0

Started byXin Wu <xin.wu@uni-paderborn.de>
First post2019-12-25 23:41 +0100
Last post2019-12-25 23:41 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  possible bug in Bash 5.0 Xin Wu <xin.wu@uni-paderborn.de> - 2019-12-25 23:41 +0100

#15780 — possible bug in Bash 5.0

FromXin Wu <xin.wu@uni-paderborn.de>
Date2019-12-25 23:41 +0100
Subjectpossible bug in Bash 5.0
Message-ID<mailman.1436.1577325994.1979.bug-bash@gnu.org>
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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web