I am trying create top command by myself. I stucked at point where i read list of running processes
IFS=$'\n'
p=$(ps -A -o %cpu -o vsz -o time -o %c --sort -%cpu | head -3 )
for i in $p
do
echo $i
done;
But when I try echo lines for some reason all "n" is replaced by "\n"
%CPU VSZ TIME COMMAND
16.3 9761940 04:06:02 firefox
9.2 3255916 02:19:27 Web Co
te
t
^C
I would appreciate any help
Thank you