How to sort pstree and add pid
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a homework - I need to create a tree of processes using fork() and replace one of them with excelp(). Tree must be sorted (so only tree I created is visible, without other processes) and should display PID.
My result at below. However, I don't know how to sort a tree in a way, that only a.out and pstree processes were shown.
https://i.imgur.com/d9ECLBT.png
I used function execlp("pstree", "pstree", "-c", (char *)0);
linux ps fork pstree
New contributor
add a comment |Â
up vote
0
down vote
favorite
I have a homework - I need to create a tree of processes using fork() and replace one of them with excelp(). Tree must be sorted (so only tree I created is visible, without other processes) and should display PID.
My result at below. However, I don't know how to sort a tree in a way, that only a.out and pstree processes were shown.
https://i.imgur.com/d9ECLBT.png
I used function execlp("pstree", "pstree", "-c", (char *)0);
linux ps fork pstree
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a homework - I need to create a tree of processes using fork() and replace one of them with excelp(). Tree must be sorted (so only tree I created is visible, without other processes) and should display PID.
My result at below. However, I don't know how to sort a tree in a way, that only a.out and pstree processes were shown.
https://i.imgur.com/d9ECLBT.png
I used function execlp("pstree", "pstree", "-c", (char *)0);
linux ps fork pstree
New contributor
I have a homework - I need to create a tree of processes using fork() and replace one of them with excelp(). Tree must be sorted (so only tree I created is visible, without other processes) and should display PID.
My result at below. However, I don't know how to sort a tree in a way, that only a.out and pstree processes were shown.
https://i.imgur.com/d9ECLBT.png
I used function execlp("pstree", "pstree", "-c", (char *)0);
linux ps fork pstree
linux ps fork pstree
New contributor
New contributor
New contributor
asked 7 mins ago
Michaà Â
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Michaà  is a new contributor. Be nice, and check out our Code of Conduct.
Michaà  is a new contributor. Be nice, and check out our Code of Conduct.
Michaà  is a new contributor. Be nice, and check out our Code of Conduct.
Michaà  is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479505%2fhow-to-sort-pstree-and-add-pid%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password