<h3>Description</h3>
<p>The <code>kamctl</code> tool seems to require <code>bash</code>, while trying to use <code>/bin/sh</code>, which can point to <code>dash</code> or other shell interpreters.</p>
<p>For example, the output of <code>kamdbctl create</code>:</p>
<pre><code>MySQL password for root:
-e \E[37;33mINFO: creating database kamailio_simple_db ...
-e \E[37;33mINFO: granting privileges to database kamailio_simple_db ...
-e \E[37;33mINFO: creating standard tables into kamailio_simple_db ...
-e \E[37;33mINFO: Core Kamailio tables succesfully created.
Install presence related tables? (y/n): n
/usr/sbin/kamdbctl: 216: /usr/sbin/kamdbctl: Bad substitution
</code></pre>
<p>It seems that the issue is expanding the variable when getting the answer for y/n question:</p>
<ul>
<li><a href="https://github.com/kamailio/kamailio/blob/master/utils/kamctl/kamdbctl.base#L216-L218">https://github.com/kamailio/kamailio/blob/master/utils/kamctl/kamdbctl.base#L216-L218</a></li>
</ul>
<p>Such expression seems to be specific for bash:</p>
<ul>
<li><a href="https://mywiki.wooledge.org/Bashism" rel="nofollow">https://mywiki.wooledge.org/Bashism</a></li>
</ul>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Run <code>kamctl</code> with <code>/bin/sh</code> pointing to <code>bash</code>.</p>
<h3>Possible Solutions</h3>
<p>Decide what to do to have an acceptable solution: enforce <code>bash</code>, remove bashisms`...</p>
<p>Or maybe focus to make <code>kamcli</code> a (full) replacement for <code>kamctl/kamdbctl</code> and get rid of those old-style shell/bash scripts:</p>
<ul>
<li><a href="https://github.com/kamailio/kamcli">https://github.com/kamailio/kamcli</a></li>
</ul>

<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/kamailio/kamailio/issues/2019?email_source=notifications&email_token=ABO7UZNQX3ANPEDKVARL25LQB3CEXA5CNFSM4IHRCASKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCAKUAA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNL7FNIVPPXCHVL6FTQB3CEXANCNFSM4IHRCASA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZNUIZPG2R64FXVUTX3QB3CEXA5CNFSM4IHRCASKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCAKUAA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2019?email_source=notifications\u0026email_token=ABO7UZNQX3ANPEDKVARL25LQB3CEXA5CNFSM4IHRCASKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCAKUAA",
"url": "https://github.com/kamailio/kamailio/issues/2019?email_source=notifications\u0026email_token=ABO7UZNQX3ANPEDKVARL25LQB3CEXA5CNFSM4IHRCASKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCAKUAA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>