sudokill
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.5 - Auxiliary function
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-22, Last change: 2025-07-20
shows details on a process and kills it
Only for toolbox developer (2025-08-09) - Not intended to be released
See Also: whoisIP
, whoisPID
, lastlogins
, whoislaunched
, whoisTCP
, whoislaunchagent
Example Illustration
Syntax
sudokill(pid,[cmd])
Input Parameter
pid: | | pid number or string |
cmd: | | explicit kill command if desired |
Examples
sudokill ('111')
sudokill ('111,'kill')
Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
The function sudokill is designed to display details about a process and optionally terminate it. It is part of the SG-Library and was developed by Tim Lueth.
Input Parameters
- pid: This can be a process ID number or a string representing the process ID.
- cmd: An optional parameter that specifies an explicit kill command if desired.
Algorithm Steps
- The function checks if the
pid is a string. If it is, it converts it to a number using str2double.
- The function retrieves the command from the optional parameters using
getfuncparams. If no command is provided, it defaults to an empty array.
- A system command is constructed using
sprintf to display process details with ps auxww for the given pid.
- The system command is executed using
system to show the process details.
- If the
cmd is equal to 'kill', the function attempts to terminate the process:
- It opens the Activity Monitor application (this line is commented out and noted as removed by Tim Lueth).
- A private kill command is constructed using
sprintf and SGdecrypt to decrypt a string, which is then used to execute a sudo kill -9 command on the process.
- The kill command is executed using
system.
Algorithm explaination created using ChatGPT on 2025-08-19 06:42. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-08-09