Ps function by c language | Sololearn: Learn to code for FREE!

+1

Ps function by c language

How can i make a function that do the work of the command ps on terminal???

@bb

4/16/2021 6:36:55 PM

Nana4 Ever

3 Answers

New Answer

+6

Nana4 Ever here is a reference which may be helpful if you are looking for processing status. https://www.geeksforgeeks.org/getting-system-and-process-information-using-c-programming-and-shell-in-linux/

+3

You can use system("ps") Or you can launch ps, your program acting as a shell with functions like this one: execvp(const char *file, char *const argv[]); see also: https://linux.die.net/man/3/execvp but the current process gets entirely replaced by the new executable process, so you need to fork processes if you want to keep running your main code. https://code.sololearn.com/cAF3ez2wm3k4/?ref=app

0

PowerShell is the only programming / scripting language that I am very good at. I initially used the PowerShell in a Month of Lunches book to get me started and thought it was helpful due to the short to the point explanations and practical exercises at the end of each lesson. Does anyone know if a similar or better resource exists when trying to learn C#? I'm trying to expand my knowledge since I occasionally run into C# code at work and would like to have at least an advanced beginner level of knowledge working with it so that I can read the code, make changes, or create my own if I need to. For those of you who learned C# after PowerShell, how long did it take to feel comfortable with the language? Thanks for your help https://www.myaarpmedicare.review/