Created
October 30, 2014 19:54
-
-
Save idserda/4184f5db4fb2f1878a48 to your computer and use it in GitHub Desktop.
Simple bash script for Mac OS X to copy data from removable media (sd card) to file, with progres information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NUMARGS=2 | |
if [ $# -ne $NUMARGS ] | |
then | |
echo "Usage: `basename $0` <file.img> </dev/diskN>" | |
exit | |
fi | |
DEVICE="$2" | |
IMAGE="$1" | |
diskutil unmountDisk $DEVICE | |
dd if=$DEVICE bs=1m | pv -ptre $DEVICE | dd of=$IMAGE bs=1m | |
diskutil eject $DEVICE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment