Chris's Wiki :: blog/programming/BourneNoMatchOperator Commentshttps://utcc.utoronto.ca/~cks/space/blog/programming/BourneNoMatchOperator?atomcommentsDWiki2010-09-05T10:20:10ZRecent comments in Chris's Wiki :: blog/programming/BourneNoMatchOperator.From 87.206.80.205 on /blog/programming/BourneNoMatchOperatortag:CSpace:blog/programming/BourneNoMatchOperator:74fe1f83d875fcb9a88227a071cd54d0e21c403bFrom 87.206.80.205<div class="wikitext"><p>Bash supports this out of the box, in [[ ]] the =~ matches regexes, but == does what you want, try this:</p>
<p><code>$ if [[ x == * ]] ; then echo it works; fi</code></p>
<p>This works only in bash's [[ ]] (after all it's an attempt to fix 'test' annoyances) and is bash-only, but that's still a lot more portable than rc.</p>
</div>2010-09-05T10:20:10Z