Hello,
I would like to spawn the following command line: yum list kernel-devel-$(uname -r)
When I try, it seems that "uname -r" is not transformed to 4.18.0-240....
Can I spawn a bash ? Or should I first get the result of "uname -r" in a variable that I could concatenate to the rest of the line to have the final result ?
Thanks for your help
Hi Stéphane,
I believe the cockpit.script() function does what you're looking for. In particular, variable interpolation spawning a unix shell and treating your command line as a "script":
https://cockpit-project.org/guide/latest/cockpit-spawn.html#cockpit-spawn-sc...
Does something like this work?
var script = cockpit.script("yum list kernel-devel-$(uname -r)");
Cheers,
Stef
On Thu, Jan 28, 2021 at 12:10 PM Stéphane List stephane.list@gmail.com wrote:
Hello,
I would like to spawn the following command line: yum list kernel-devel-$(uname -r)
When I try, it seems that "uname -r" is not transformed to 4.18.0-240....
Can I spawn a bash ? Or should I first get the result of "uname -r" in a variable that I could concatenate to the rest of the line to have the final result ?
Thanks for your help _______________________________________________ cockpit-devel mailing list -- cockpit-devel@lists.fedorahosted.org To unsubscribe send an email to cockpit-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/cockpit-devel@lists.fedorahoste...
Thanks Stef,
Yes it works.
Le jeu. 28 janv. 2021 à 12:24, Stef Walter swalter@redhat.com a écrit :
Hi Stéphane,
I believe the cockpit.script() function does what you're looking for. In particular, variable interpolation spawning a unix shell and treating your command line as a "script":
https://cockpit-project.org/guide/latest/cockpit-spawn.html#cockpit-spawn-sc...
Does something like this work?
var script = cockpit.script("yum list kernel-devel-$(uname -r)");
Cheers,
Stef
On Thu, Jan 28, 2021 at 12:10 PM Stéphane List stephane.list@gmail.com wrote:
Hello,
I would like to spawn the following command line: yum list kernel-devel-$(uname -r)
When I try, it seems that "uname -r" is not transformed to 4.18.0-240....
Can I spawn a bash ? Or should I first get the result of "uname -r" in a variable that I could concatenate to the rest of the line to have the final result ?
Thanks for your help _______________________________________________ cockpit-devel mailing list -- cockpit-devel@lists.fedorahosted.org To unsubscribe send an email to cockpit-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/cockpit-devel@lists.fedorahoste...
-- Stef Walter (he / his) Linux Engineering Red Hat _______________________________________________ cockpit-devel mailing list -- cockpit-devel@lists.fedorahosted.org To unsubscribe send an email to cockpit-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/cockpit-devel@lists.fedorahoste...
cockpit-devel@lists.fedorahosted.org