On Fri, Jun 5, 2009 at 1:10 AM, Pan ruochen wrote: > Hi All, > > My current version of bash on cygwin failed to match this pattern: > ******************************* > target=ar > if [[ "$target" =~ '^a' ]]; then > echo Matched > else > echo Unmatched > fi
Not a Cygwin question.; that fails in any bash. The quotes suppress the special meaning of ^ and make it try to match literally. Lose them: if [[ "$target" =~ ^a ]]; then ... -- Mark J. Reed <markjr...@gmail.com> -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/