An issue with Tools > Command Shell

SYSTEM INFORMATION
OS type and version Debian Linux 12
Webmin version 2.610

After default installation of Webmin I logged in as a user that is member of sudo group.
I tried running inxi command in the Command Shell but it is returning an error. Here is the output that may be relevant:

> whoami
root
> pwd
/root
> echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
> which inxi
/bin/inxi
> inxi
Undefined subroutine &main::get_cmdline called at /bin/inxi line 6382.

Here is the output of these commands in CLI of the server (bash shell):

$ sudo -i
# whoami
root
# cd /
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# which inxi
/usr/bin/inxi
# inxi
CPU: single core Intel Xeon Silver 4215 (-MT-) speed: 2494 MHz Kernel: 6.1.0-41-amd64 x86_64
Up: 13d 7h 3m Mem: 927.1/1832.2 MiB (50.6%) Storage: 20 GiB (30.5% used) Procs: 126 Shell: Bash
inxi: 3.3.26

I see that /bin/inxi is a Perl script. Is it a problem to Webmin which also runs in Perl?

Is there a workaround for that issue?

– rpr.

No. Running Perl scripts in the Command Shell usually works just fine. There’s something about your script that isn’t happy in the very limited environment Command Shell can offer.

Try it in the Terminal instead. It’s a full terminal, while Command Shell can’t have an environment, deal well with subshells, or do anything that would require an interactive terminal or terminal control. The Terminal is much heavier, as it has to start up a backend websocket server to connect xterm.js to a login session, but it behaves pretty much like a regular terminal (like logging in via ssh or locally with a keyboard and monitor).

inxi is not my script but a popular tool for getting various system information.

The error says that subroutine main::get_cmdline called at line 6382 is undefined.

I see that the sub get_cmdline is defined in line 6431 of that script.

There must be something buggy in the way webmin is running commands specified in Command Shell section.

– rpr.

so did you try to run it in Webmin ->Terminal?
the script sounds like it is trying to do too much

It works fine in Terminal.

Ah, good. “Solved” then :+1:
just as @joe said. I have never found Webmin -> Tools -> Command shell of much use other than for very short scripts and this one was attempting to do too much