Converting bash script into pie chart
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
How to convert output of this command ps aux | awk 'NR>1tot[$3]++; ENDfor(id in tot)printf "%s %sn",id,tot[id]'
into pie chart.
I have tried to make changes in the following script using the link
ps aux | awk '
function rc()r=rand()*255;g=rand()*255;b=rand()*255;
BEGINsrand(10);X=-90;Y=120;
NR>1
tot[$3]++;
rc();
printf("n",
X,Y,r,g,b);
printf("%sn",X+30,Y+15,$0);
Y+=25;
END{srand(10);
R=100;PX=R;PY=0;
#PROCINFO["sorted_in"]="@ind_num_asc";
for(id in tot) # <--- See: http://xed.ch/blog/2016/1219.html
#for(i=1;i<=length(L);i++)
A=tot[id]6.283185307;
#L[i]>S/2?B=1:B=0;
X=Rcos(A);Y=R*sin(A); rc()
printf("n",
PX,PY,B,X,Y,r,g,b);
PX=X;PY=Y;
'
Is there any better method drawing piechart in bash script?
bash shell-script
New contributor
add a comment |Â
up vote
0
down vote
favorite
How to convert output of this command ps aux | awk 'NR>1tot[$3]++; ENDfor(id in tot)printf "%s %sn",id,tot[id]'
into pie chart.
I have tried to make changes in the following script using the link
ps aux | awk '
function rc()r=rand()*255;g=rand()*255;b=rand()*255;
BEGINsrand(10);X=-90;Y=120;
NR>1
tot[$3]++;
rc();
printf("n",
X,Y,r,g,b);
printf("%sn",X+30,Y+15,$0);
Y+=25;
END{srand(10);
R=100;PX=R;PY=0;
#PROCINFO["sorted_in"]="@ind_num_asc";
for(id in tot) # <--- See: http://xed.ch/blog/2016/1219.html
#for(i=1;i<=length(L);i++)
A=tot[id]6.283185307;
#L[i]>S/2?B=1:B=0;
X=Rcos(A);Y=R*sin(A); rc()
printf("n",
PX,PY,B,X,Y,r,g,b);
PX=X;PY=Y;
'
Is there any better method drawing piechart in bash script?
bash shell-script
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How to convert output of this command ps aux | awk 'NR>1tot[$3]++; ENDfor(id in tot)printf "%s %sn",id,tot[id]'
into pie chart.
I have tried to make changes in the following script using the link
ps aux | awk '
function rc()r=rand()*255;g=rand()*255;b=rand()*255;
BEGINsrand(10);X=-90;Y=120;
NR>1
tot[$3]++;
rc();
printf("n",
X,Y,r,g,b);
printf("%sn",X+30,Y+15,$0);
Y+=25;
END{srand(10);
R=100;PX=R;PY=0;
#PROCINFO["sorted_in"]="@ind_num_asc";
for(id in tot) # <--- See: http://xed.ch/blog/2016/1219.html
#for(i=1;i<=length(L);i++)
A=tot[id]6.283185307;
#L[i]>S/2?B=1:B=0;
X=Rcos(A);Y=R*sin(A); rc()
printf("n",
PX,PY,B,X,Y,r,g,b);
PX=X;PY=Y;
'
Is there any better method drawing piechart in bash script?
bash shell-script
New contributor
How to convert output of this command ps aux | awk 'NR>1tot[$3]++; ENDfor(id in tot)printf "%s %sn",id,tot[id]'
into pie chart.
I have tried to make changes in the following script using the link
ps aux | awk '
function rc()r=rand()*255;g=rand()*255;b=rand()*255;
BEGINsrand(10);X=-90;Y=120;
NR>1
tot[$3]++;
rc();
printf("n",
X,Y,r,g,b);
printf("%sn",X+30,Y+15,$0);
Y+=25;
END{srand(10);
R=100;PX=R;PY=0;
#PROCINFO["sorted_in"]="@ind_num_asc";
for(id in tot) # <--- See: http://xed.ch/blog/2016/1219.html
#for(i=1;i<=length(L);i++)
A=tot[id]6.283185307;
#L[i]>S/2?B=1:B=0;
X=Rcos(A);Y=R*sin(A); rc()
printf("n",
PX,PY,B,X,Y,r,g,b);
PX=X;PY=Y;
'
Is there any better method drawing piechart in bash script?
bash shell-script
bash shell-script
New contributor
New contributor
New contributor
asked 4 mins ago
Satyam Kumar
11
11
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
Satyam Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Satyam Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Satyam Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Satyam Kumar 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%2f480283%2fconverting-bash-script-into-pie-chart%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