- 论坛徽章:
- 0
|
查了一下资料
var=$(mysql -u root -proot123 -e "select concat(pid, ' ', process, ' ', processstat, ' ', Time, ' ', cpu, ' ', memory, ' ', vmemory, ' ', result, '\n') from test.resource")
echo $var
echo $var|awk '{print $2}'
结果是变成
concat(pid, ' ', process, ' ', processstat, ' ', Time, ' ', cpu, ' ', memory, ' ', vmemory, ' ', result, '\n') 29828 test S 00:00:00 0 0 13812 248\n 33024 test S 00:00:00 0 0 13812 248\n 37814 test S 00:00:00 0 0 13812 248\n 38752 test S 00:00:00 0 0 13812 248\n 42552 test S 00:00:00 0 0 13812 248\n 44365 test S 00:00:00 0 0 13812 248\n 45338 test S 00:00:00 0 0 13812 248\n
' |
|