Skip to content

Instantly share code, notes, and snippets.

@T-rex2017
Created March 7, 2021 15:39
Show Gist options
  • Select an option

  • Save T-rex2017/568c521f8b236b7fe0d9eb515f2dfa6a to your computer and use it in GitHub Desktop.

Select an option

Save T-rex2017/568c521f8b236b7fe0d9eb515f2dfa6a to your computer and use it in GitHub Desktop.

Revisions

  1. T-rex2017 created this gist Mar 7, 2021.
    21 changes: 21 additions & 0 deletions change_gcode.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/bin/sh

    echo "input file : "$1

    echo "G0 S0 >> G0 Z4.5"
    sed -i 's/G0 S0/G0 Z4.5/g' $1

    echo "G0 S255 >> G0 Z3.9"
    sed -i 's/G0 S255/G0 Z3.9/g' $1

    echo " " >> $1

    echo "G0 Z10.0 ;"
    echo "G0 Z10.0 ;" >> $1

    echo "G0 X0.0 Y160.0 ;"
    echo "G0 X0.0 Y160.0 ;" >> $1

    echo "M84 X Y Z E ;"
    echo "M84 X Y Z E ;" >> $1