Path: csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!usenet.stanford.edu!not-for-mail From: Corentin Peuvrel Newsgroups: gnu.bash.bug Subject: Comparison problem with case modification expansion in bash-4.3 Date: Tue, 3 Nov 2015 15:03:56 +0100 Lines: 27 Approved: bug-bash@gnu.org Message-ID: References: <55DC9992.8070209@pom-monitoring.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1446559469 29957 208.118.235.17 (3 Nov 2015 14:04:29 GMT) X-Complaints-To: action@cs.stanford.edu Cc: Julien Thomas To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Virus-Scanned: amavisd-new at exosec.local X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: <55DC9992.8070209@pom-monitoring.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.90.99.101 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:11820 Hi, I think I found a bug in bash-4.3 (4.3.42 in fedora 21), that seems to exists for a long time (at least from 4.1.2 in Centos 6). I found a fairly simple way to reproduce it : you have to initialize a variable to an empty string, and do a comparaison to it while doing the case modification expansion ${var,,} This doesn't work : # foo="" ; [[ bar == *"${foo,,}"* ]] && echo ok While this works fine : # foo="" ; [[ bar == *"${foo}"* ]] && echo ok ok If you unset the variable, it works as we want : # unset foo ; [[ bar == *"${foo,,}"* ]] && echo ok ok If the variable is not empty, it also works normally : # foo="A" ; [[ bar == *"${foo,,}"* ]] && echo ok ok I hope it's not already known, but I couldn't find anything on the net. Thank you, Corentin Peuvrel