I want to get onre output of top to variable for future processing. I tried:
top=$(top -n1)
top=$(top -n1 -w80)
top=$(top -n1 -b -w80)
top=$(COLUMNS=100 top -b-n1)
When I run echo $top
then I see something like on the screenshot
that is
top
output completely without line breaks. What am I doing wrong?
uptime
– Kusalananda Nov 17 '17 at 11:20