Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [62.221.7.122] From: "Nrusinh Ambekar" To: cygwin AT cygwin DOT com Subject: problem - if statement in shell script gives opposite results with new bash Date: Wed, 02 Oct 2002 09:27:23 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 02 Oct 2002 09:27:23.0834 (UTC) FILETIME=[EA48D1A0:01C269F5] Hi, I have recently downloaded new cygwin. I am getting incorrect results when I run simple shell script using bash. The same shell script runs fine with old cygwin bash. Your help is really appreciated. thanks, Nrusinh The script is as follows #!/usr/local/bin/bash myfunc() { local item=$1 shift 1 local list=" $* " echo "item is" echo $item echo "list is" echo $list if [ "${item}" = "${list}" ] || [ "${list#"* ${item} *"}" != "${list}" ] || [ "${list#"${item} "}" != "${list}" ] || [ "${list%" ${item}"}" != "${list}" ] then echo "found" else echo "not found" fi } myfunc CECA OTA OEA CECA _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/