strange behavior of shellscript component
Andreas Unterkircher <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I want to execute the shell command "echo `hostname -f` > /tmp/foo.txt"
with the new shellscript component. Executing this command with
os.runshell works, but with the schellscript components I'm running into
trouble. The below descripton does not work, in fact I get a file
"/tmp/foo.txt],". with the content
MARK - done HOST oplabox03.cern.ch:rootProcess:test:shell [[echo
oplabox03.cern.ch 2005/07/05 16:40:12:163 CEST] Exit code#: 0
BTW, I have to define my own bash shell as the BashExec component defined
in org/smartfrog/services/shellscript/components.sf has "/etc/bash" as
cmd. This is not available on my machine; I think it would be better to
define cmd as "/bin/bash" which should be available on standard Linux
machines. Here's the component description. Do you know why it does not work ?
#include "org/smartfrog/services/shellscript/components.sf"
localShellExec extends ShellExec {
cmd ["/bin/bash"];
echoErrorCmd "$?";
}
localShell extends Shell {
exec extends localShellExec;
}
sfConfig extends Compound {
shell extends localShell;
doScript extends Script {
shell LAZY ATTRIB shell;
startScript ["echo `hostname -f` > /tmp/foo.txt"];
autoTerminate true;
}
}
Thank you very much for your help.
Best regards,
Andreas
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click