i-nex / I-Nex

System information tool written in gambas3, python, bash
http://i-nex.linux.pl/
174 stars 24 forks source link

gawk improvement #22

Closed ghost closed 8 years ago

ghost commented 8 years ago

Just to get you started in the right direction.

get_lspci() {
# your cmd to obtain the gpu information ... 
 | gawk '{ gsub(/size|[[:punct:]]/,""); for (x=1; x<NF; x++) { if (match($x,/^'$1'/)) { print $(x+1); } } }'
}

get_lspci 'nonprefetchable'
get_lspci 'prefetchable'