답변1
큰따옴표 변수
echo "${top}"
할당 후 시도top="$(top -n1)"
답변2
복사할 수 없음:
$ t="$( top -b -n1 )"
$ echo "$t" | head -n3
top - 14:49:52 up 243 days, 17:18, 2 users, load average: 0.03, 0.07, 0.12
Tasks: 205 total, 1 running, 203 sleeping, 1 stopped, 0 zombie
%Cpu(s): 2.4 us, 0.5 sy, 0.1 ni, 96.4 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st