{gpus =0 match($0, /gres\/gpu=([[:digit:]]+)/,a) gpus+= a[1] print gpus}
billing=72,cpu=72,gres/gpu=10,gres/gpu:a100=2,gres/gpu:l40s=8,mem=245000M,node=3
10
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!