{match($0, /gres\/gpu=([[:digit:]]+)/); out = substr($0, RSTART+1, RLENGTH-1); split(out,a,"=")print a[2]}
billing=1,cpu=1,gres/gpu=2,mem=245000M,node=1
2
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!