Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-28 Thread Ignacio Vazquez-Abrams
On Mon, 2009-04-27 at 22:37 +0200, Martin Langhoff wrote: Hi all, I have a simple shell scripting problem :-) you'll find attached a shell script that ships with ejabberd. It is a fairly straightforward bit of code, and allows us to control bits of the ejabberd internals with a nice cli

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-28 Thread Ignacio Vazquez-Abrams
On Tue, 2009-04-28 at 11:17 +0200, Martin Langhoff wrote: On Tue, Apr 28, 2009 at 9:27 AM, Ignacio Vazquez-Abrams ivazquez...@gmail.com wrote: # in the script, the CMD is built up as a string CMD=touch $@ http://mywiki.wooledge.org/BashFAQ/050 That repeats what we know already. The

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-28 Thread Martin Langhoff
On Tue, Apr 28, 2009 at 1:01 PM, Ignacio Vazquez-Abrams ivazquez...@gmail.com wrote: Which part of the following doesn't work? Just test your minimal 3 line script with the example input I've given you. It breaks: # cat sample.sh #! /bin/bash CMD=(touch $@) bash -c ${c...@]} # ./sample.sh

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-28 Thread pgf
bert wrote: On 28.04.2009, at 13:37, Martin Langhoff wrote: On Tue, Apr 28, 2009 at 1:19 PM, Ignacio Vazquez-Abrams ivazquez...@gmail.com wrote: Ah, I see now. Try this: bash -c 'touch $@' ${c...@]} Riiight, that works better... but Or in the case of the

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-28 Thread Ignacio Vazquez-Abrams
On Tue, 2009-04-28 at 12:38 +0200, Martin Langhoff wrote: On Tue, Apr 28, 2009 at 12:03 PM, Ignacio Vazquez-Abrams ivazquez...@gmail.com wrote: But if you're willing to let go of this futile quest to keep $CMD a string then you'll find that it can be done: Your example doesn't work. I

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-28 Thread Martin Langhoff
On Tue, Apr 28, 2009 at 9:27 AM, Ignacio Vazquez-Abrams ivazquez...@gmail.com wrote: # in the script, the CMD is built up as a string CMD=touch $@ http://mywiki.wooledge.org/BashFAQ/050 That repeats what we know already. The thing is that we are building the command as a string for runuser,

[Server-devel] Fixing bash script bogosity - help?

2009-04-27 Thread Martin Langhoff
Hi all, I have a simple shell scripting problem :-) you'll find attached a shell script that ships with ejabberd. It is a fairly straightforward bit of code, and allows us to control bits of the ejabberd internals with a nice cli interface. (Feel free to skip the start / stop bits of the code,

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-27 Thread pgf
hi martin -- I have a simple shell scripting problem :-) you'll find attached a shell script that ships with ejabberd. It is a fairly straightforward bit of code, and allows us to control bits of the ejabberd internals with a nice cli interface. (Feel free to skip the start / stop bits of

Re: [Server-devel] Fixing bash script bogosity - help?

2009-04-27 Thread Sean DALY
I'm no maven, but the last time I was dealing with quoting issues with $* expansion I had found this article helpful: http://www.ibm.com/developerworks/library/l-bash-parameters.html?ca=drs- Sean On Mon, Apr 27, 2009 at 10:37 PM, Martin Langhoff martin.langh...@gmail.com wrote: Hi all, I