problem - if statement in shell script gives opposite results with new bash

Nrusinh Ambekar nrusinh@hotmail.com
Wed Oct 2 02:27:00 GMT 2002


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/



More information about the Cygwin mailing list