I want to write a script that will dump all partitions of my android device through the android debug bridge and since this is a time intensive process I want to notify the user about the progress by echoing out messages after certain key events happen. To my surprise I have noticed that sometimes
echo does not print all the characters that it should.
The smallest sample that reproduces the error is:
#!/bin/bash targets=$(adb shell "ls /dev/block/nand*") for item in $targets; do echo "Processing $item" echo "dd if=$item bs=4M" done
This produces the following output:
Processing /dev/block/nanda dd if=/dev/block/nanda bs=4M Processing /dev/block/nandd dd if=/dev/block/nandd bs=4M Processing /dev/block/nandg dd if=/dev/block/nandg bs=4M Processing /dev/block/nandj bs=4M/dev/block/nandj Processing /dev/block/nandb dd if=/dev/block/nandb bs=4M Processing /dev/block/nande dd if=/dev/block/nande bs=4M Processing /dev/block/nandh bs=4M/dev/block/nandh Processing /dev/block/nandc dd if=/dev/block/nandc bs=4M Processing /dev/block/nandf dd if=/dev/block/nandf bs=4M Processing /dev/block/nandi bs=4M/dev/block/nandi
Why does this happen and how can I fix it?