#!/bin/bash SERIAL=/dev/tty.USA19QWfd31P1.1 echo -ne "7" > $SERIAL sleep 1 echo -ne "10000000\r" > $SERIAL sleep 1 printf "%08x\r" `stat -f %z image` > $SERIAL sleep 1 cat image > $SERIAL sleep 1 echo -ne 5 > $SERIAL sleep 1 echo 10000000 > $SERIAL