<p>Oh.  Yeah Geany read shebangs and use those over the extension to determine the file type.  In your example it's indeed impractical because there is actually 2 different syntax in the same file, but I'm afraid it's a little too complex to deal with, as it measn actually understanding what the shell script <em>does</em>.</p>

<p>Also, the <code>env</code> technique mentioned in your link is really better unless it actually has a drawback for you, because it's simpler, spawns a simpler intermediate program (<code>env</code> is a lot lighter than <code>sh</code> -- let alone <code>bash</code>), and is common in other languages too, like Python (which commonly uses <code>#!/usr/bin/env python</code>).<br>
And it won't confuse tools parsing the shebang line either, because they will either not know about the language <code>env</code> uses, or they will understand the construct and read the name of the next argument (so here that would be <code>wish</code>) and base a guess on that.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1295#issuecomment-259380783">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ1-dosPjQoY2sDVCoPvQ78Nfu5lBks5q8Z8BgaJpZM4Ksg97">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ5_xDStZbG2wKz4BSkg3vUp56xsLks5q8Z8BgaJpZM4Ksg97.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1295#issuecomment-259380783"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n in #1295: Oh.  Yeah Geany read shebangs and use those over the extension to determine the file type.  In your example it's indeed impractical because there is actually 2 different syntax in the same file, but I'm afraid it's a little too complex to deal with, as it measn actually understanding what the shell script *does*.\r\n\r\nAlso, the `env` technique mentioned in your link is really better unless it actually has a drawback for you, because it's simpler, spawns a simpler intermediate program (`env` is a lot lighter than `sh` -- let alone `bash`), and is common in other languages too, like Python (which commonly uses `#!/usr/bin/env python`).\r\nAnd it won't confuse tools parsing the shebang line either, because they will either not know about the language `env` uses, or they will understand the construct and read the name of the next argument (so here that would be `wish`) and base a guess on that."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1295#issuecomment-259380783"}}}</script>