shell不区分大小写字符串比较

#convert win path to linux path value as linux sensitive with character lower or upper
orgi=`echo $1|tr "[:upper:]" "[:lower:]"`
for i in `ls $PMSOURCEDIR`
do
  tmp=$i
  dest=`echo $i|tr "[:upper:]" "[:lower:]"`
  if [ $orgi = $dest ]; then
    break
  fi
done

你可能感兴趣的:(shell)