Hi. I've made a bash script to get the X & Y limits of

Hi.
I’ve made a bash script to get the X & Y limits of a gcode file:

Filename: getlimitcnc.sh (remember to chmod +x)

#!/bin/bash
cat $1 | grep oEi 'X(?[0-9].?([0-9])?) ’ | cut c2 | awk ‘{if(min==“”){min=max=$1}; if($1>max) {max=$1}; if($1< min) {min=$1}; total+=$1; count+=1} END {print “X-min:” min, “X-max:” max}’
cat $1 | grep oEi 'Y(?[0-9].?([0-9])?) ’ | cut c2 | awk ‘{if(min==“”){min=max=$1}; if($1>max) {max=$1}; if($1< min) {min=$1}; total+=$1; count+=1} END {print “Y-min:” min, “Y-max:” max}’

Link to ideone for better formatting: 3dTN8M - Online Bash Interpreter & Debugging Tool - Ideone.com

To use it just run:
./getlimitcnc.sh /somepath/http://gcodefile.nc

Hope that someone find it usefull.