EMC based reprap working and printing but I need programming help! November 30, 2008 12:52PM |
Registered: 17 years ago Posts: 29 |
Re: EMC based reprap working and printing but I need programming help! December 05, 2008 08:09AM |
Registered: 16 years ago Posts: 100 |
sed -e 's/^[mM]101/M8/' -e 's/^[mM]103/M9/' -e 's/^[mM]104.*$//' -e 's/^[mM]105.*$//' -e '/^$/ d' fileIn > fileOutIf you need to convert other commands just add an extra, (XXX is the command to replace, MYYY is the replacement command):
-e '/^[mM]XXX/MYYY/'or to remove a type of command add, (XXX is the number of the command to remove):
-e '/^[mM]XXX.$//'The final -e block removes blank lines created where m104 and m105 commands were.
cat < convert.sh #!/bin/sh if [ \$# -ne 2 ]; then echo 1>&2 Usage: \$0 \ \ \$ exit 127 fi /bin/sed -e 's/^[mM]101/M8/' -e 's/^[mM]103/M9/' -e 's/^[mM]104.*$//' -e 's/^[mM]105.*$//' -e '/^$/ d' \$1 > \$2 EOF chmod a+x convert.sh