perlquestion
bronto
<p>
Dearest monks and nuns.
</p>
<p>
Recently I have been bitten by an unexpected behaviour of a commercial software. In short, if I started a daemon with qx in a perl script, it failed to work properly.
</p>
<p>
I am still investigating. Anyway, it seems that the daemon fails to work properly if it doesn't run under a "classic" Bourne shell, while qx runs it inside a Bash shell.
</p>
<p>The following script:</p>
<code>
#!/usr/bin/perl
use strict ;
use warnings ;
my $output = qx'echo $SHELL' ;
print $output ;
</code>
<p>returns</p>
<code>/bin/bash</code>
<p>
The man page for qx says:
</p>
<blockquote><code>
qx/STRING/
‘STRING‘
A string which is (possibly) interpolated and then exe-
cuted as a system command with "/bin/sh" or its equiva-
lent.[...]
</code></blockquote>
<p>
This leads me to the question: how does qx select the aforementioned "/bin/sh equivalent"?
</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-175325">
<p>Ciao!<br><tt>--bronto</tt></p>
<hr>
<blockquote><small><i>In theory, there is no difference between theory and practice. In practice, there is.</i></small></blockquote>
</div></div>