On 2/10/24 16:01, ToddAndMargo via perl6-users wrote:
On 2/10/24 15:26, Marc Chantreux wrote:
On Thu, Feb 08, 2024 at 02:25:00PM -0800, ToddAndMargo via perl6-users
wrote:
Actually, I am looking for the name of the calling program:
Cobian, Task manager, deamon, etc..
linux centric anwser:
raku -e 'say "/proc/{"/proc/$*PID/stat".IO.words[3]}/comm".IO.lines[0]'
hth
$ raku -e 'say "/proc/{"/proc/$*PID/stat".IO.words[3]}/comm".IO.lines[0]'
bash
Very cool. Thank you.
I also need (only a little bit, I figured a way
around it) to kow how to do it in Windows.
Winsdows no so cool. perl -e does not get past the
quoting issue from the command console.
So:
>raku
[0] > say "/proc/{"/proc/$*PID/stat".IO.words[3]}/comm".IO.lines[0]
Failed to open file K:\proc\6640\stat: No such file or directory
in method throw at 'SETTING::'src/core.c/Exception.rakumod line 65
in method fail at 'SETTING::'src/core.c/Exception.rakumod line 89
in block at 'SETTING::'src/core.c/IO/Handle.rakumod line 158
in method open at 'SETTING::'src/core.c/IO/Handle.rakumod line 155
in method open at 'SETTING::'src/core.c/IO/Path.rakumod line 212
in method words at 'SETTING::'src/core.c/IO/Path.rakumod line 805
in block <unit> at <unknown file> line 1