Wildcards are expanded by a shell, so you want:
On 15.11.2017 15:43, Mark Reynolds wrote:
Basically if I try to use wildcards or pipes things seem to break:
> var cmd = ["/usr/bin/ls", "/etc/dirsrv/slapd-*"];
var cmd = ["/bin/sh", "-c", "/usr/bin/ls
/etc/dirsrv/slapd-*"];
Hope that helps,
Stef
cockpit.spawn(cmd, { superuser: true }).done(function(data) {
insts = new String(data);
$("#Title").text(data); }
).fail(function(error){
$("#Title").text(error);
});
I get this error response: "/usr/bin/ls exited with code 2"
I get the same error when trying this:
var cmd = ["/usr/bin/ls", "/etc/dirsrv/", "|",
"/usr/bin/grep",
"slapd"];
But this works fine:
var cmd = ["/usr/bin/ls", "/etc/dirsrv/"];
Is this a bug, or do I need to do something different?
Thanks,
Mark
_______________________________________________
cockpit-devel mailing list -- cockpit-devel(a)lists.fedorahosted.org
To unsubscribe send an email to cockpit-devel-leave(a)lists.fedorahosted.org