linuxcnc/nc_files/M101
Dewey Garrett 7a30619460 M101 example: print file location to stdout
Give help locating built-in user m code example (M101)
2014-01-15 19:16:50 -07:00

22 lines
516 B
Bash
Executable file

#!/bin/sh
# M101 in your G code program will run the Linux commands in this
# shell script "batch" file, passing the P and Q variables as command
# line arguments.
# give the command line arguments descriptive names
P=$1
Q=$2
MCMD=$(readlink -nf $0) ;# canonical file name
MNAME=$(basename $MCMD)
echo
echo "Example for User M code invocation:"
echo "M code File: $MCMD"
echo "$MNAME P$P Q$Q"
# if a M1nn command exits with nonzero status,
# the gcode program exits. So always exit 0.
exit 0 ;# 0 for success