Arduino IDEのEdisonに対する挙動

#!/bin/sh
#
# clupload script to invoke lsz 
# Copyright (C) 2014 Intel Corporation
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#

echo "starting download script"
echo "Args to shell:" $*
#
# ARG 1: Path to lsz executable.
# ARG 2: Elf File to download
# ARG 3: TTY port to use.
#
#path may contain \ need to change all to /
path_to_exe=$1
fixed_path=${path_to_exe//\\/\/}
#
tty_port_id=$3
echo "Serial Port PORT" $com_port_id "(note: should be /dev/cu.xxxxxx for OSX)"
echo "Using tty Port" $tty_port_id 
#
echo "Sending Command String to move to download if not already in download mode"
echo "~sketch downloadEdison" > $tty_port_id
#Give the host time to stop the process and wait for download
sleep 1
starting download script
Args to shell: /Users/shohei/Library/Arduino15/packages/Intel/tools/sketchUploader/1.6.2+1.0/x86/bin /var/folders/gp/l764g7197_77rf1z02j1k9dc0000gn/T/build37b717365013c114625ee1c10654e975.tmp/Blink.ino.elf /dev/cu.usbmodem1423
Serial Port PORT (note: should be /dev/cu.xxxxxx for OSX)
Using tty Port /dev/cu.usbmodem1423
Sending Command String to move to download if not already in download mode
#
Deleting existing sketch on target
#Move the existing sketch on target.
echo "Deleting existing sketch on target"
"$fixed_path/lsz" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" < $tty_port_id > $tty_port_id

Transfer incomplete
#"$fixed_path/lsz.exe" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" < $tty_port_id > $tty_port 1>&0
#
# Execute the target download command
#
#Download the file.
host_file_name=$2
"$fixed_path/lsz" --escape --binary --overwrite $host_file_name < $tty_port_id  > $tty_port_id
Sending: Blink.ino.elf
Moving downloaded file to /sketch/sketch.elf on target

Bytes Sent:   1024/  75668   BPS:489510   ETA 00:00  
Bytes Sent:   9216/  75668   BPS:2334926  ETA 00:00  
Bytes Sent:  10240/  75668   BPS:2488537  ETA 00:00  
Bytes Sent:  11264/  75668   BPS:2664822  ETA 00:00  
Bytes Sent:  12288/  75668   BPS:2757013  ETA 00:00  
Bytes Sent:  13312/  75668   BPS:2907899  ETA 00:00  
Bytes Sent:  14336/  75668   BPS:2849606  ETA 00:00  
Bytes Sent:  15360/  75668   BPS:2976827  ETA 00:00  
Bytes Sent:  16384/  75668   BPS:3081452  ETA 00:00  
Bytes Sent:  17408/  75668   BPS:3129235  ETA 00:00  
Bytes Sent:  18432/  75668   BPS:3215063  ETA 00:00  
Bytes Sent:  19456/  75668   BPS:3332151  ETA 00:00  
Bytes Sent:  20480/  75668   BPS:3452546  ETA 00:00  
Bytes Sent:  21504/  75668   BPS:3393442  ETA 00:00  
Bytes Sent:  22528/  75668   BPS:3496494  ETA 00:00  
Bytes Sent:  23552/  75668   BPS:3593591  ETA 00:00  
Bytes Sent:  24576/  75668   BPS:3616307  ETA 00:00  
Bytes Sent:  25600/  75668   BPS:3698349  ETA 00:00  
Bytes Sent:  26624/  75668   BPS:3651705  ETA 00:00  
Bytes Sent:  27648/  75668   BPS:3737763  ETA 00:00  
Bytes Sent:  28672/  75668   BPS:3680686  ETA 00:00  
Bytes Sent:  29696/  75668   BPS:3753776  ETA 00:00  
Bytes Sent:  30720/  75668   BPS:3686983  ETA 00:00  
Bytes Sent:  31744/  75668   BPS:3714954  ETA 00:00  
Bytes Sent:  32768/  75668   BPS:3604483  ETA 00:00  
Bytes Sent:  33792/  75668   BPS:3651994  ETA 00:00  
Bytes Sent:  34816/  75668   BPS:3666027  ETA 00:00  
Bytes Sent:  35840/  75668   BPS:3611123  ETA 00:00  
Bytes Sent:  36864/  75668   BPS:3642031  ETA 00:00  
Bytes Sent:  37888/  75668   BPS:3680263  ETA 00:00  
Bytes Sent:  38912/  75668   BPS:3576159  ETA 00:00  
Bytes Sent:  39936/  75668   BPS:3604323  ETA 00:00  
Bytes Sent:  40960/  75668   BPS:3622916  ETA 00:00  
Bytes Sent:  41984/  75668   BPS:3659393  ETA 00:00  
Bytes Sent:  43008/  75668   BPS:3631230  ETA 00:00  
Bytes Sent:  44032/  75668   BPS:3582193  ETA 00:00  
Bytes Sent:  45056/  75668   BPS:3584978  ETA 00:00  
Bytes Sent:  46080/  75668   BPS:3570477  ETA 00:00  
Bytes Sent:  47104/  75668   BPS:3591893  ETA 00:00  
Bytes Sent:  48128/  75668   BPS:3594626  ETA 00:00  
Bytes Sent:  49152/  75668   BPS:3574733  ETA 00:00  
Bytes Sent:  50176/  75668   BPS:3609835  ETA 00:00  
Bytes Sent:  51200/  75668   BPS:3547214  ETA 00:00  
Bytes Sent:  52224/  75668   BPS:3574291  ETA 00:00  
Bytes Sent:  53248/  75668   BPS:3596893  ETA 00:00  
Bytes Sent:  54272/  75668   BPS:3569374  ETA 00:00  
Bytes Sent:  55296/  75668   BPS:3596065  ETA 00:00  
Bytes Sent:  56320/  75668   BPS:3539242  ETA 00:00  
Bytes Sent:  57344/  75668   BPS:3560647  ETA 00:00  
Bytes Sent:  58368/  75668   BPS:3575845  ETA 00:00  
Bytes Sent:  59392/  75668   BPS:3563880  ETA 00:00  
Bytes Sent:  60416/  75668   BPS:3521590  ETA 00:00  
Bytes Sent:  61440/  75668   BPS:3552103  ETA 00:00  
Bytes Sent:  62464/  75668   BPS:3513195  ETA 00:00  
Bytes Sent:  63488/  75668   BPS:3542476  ETA 00:00  
Bytes Sent:  64512/  75668   BPS:3511464  ETA 00:00  
Bytes Sent:  65536/  75668   BPS:3540005  ETA 00:00  
Bytes Sent:  66560/  75668   BPS:3566246  ETA 00:00  
Bytes Sent:  67584/  75668   BPS:3531605  ETA 00:00  
Bytes Sent:  68608/  75668   BPS:3560187  ETA 00:00  
Bytes Sent:  69632/  75668   BPS:3517835  ETA 00:00  
Bytes Sent:  70656/  75668   BPS:3539554  ETA 00:00  
Bytes Sent:  71680/  75668   BPS:3556109  ETA 00:00  
Bytes Sent:  72704/  75668   BPS:3517744  ETA 00:00  
Bytes Sent:  73728/  75668   BPS:3508203  ETA 00:00  
Bytes Sent:  74752/  75668   BPS:3536228  ETA 00:00  
Bytes Sent:  75668   BPS:3349493                         

Transfer complete
#
#mv the downloaded file to /sketch/sketch.elf 
target_download_name="${host_file_name##*/}" 
echo "Moving downloaded file to /sketch/sketch.elf on target"
"$fixed_path/lsz" --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" < $tty_port_id > $tty_port_id

Transfer complete
#
#