Skip to content

Instantly share code, notes, and snippets.

@danielkucera
Created March 12, 2019 19:01
Show Gist options
  • Save danielkucera/8feca88a93ca3ffe917f31ab26d1c9ab to your computer and use it in GitHub Desktop.
Save danielkucera/8feca88a93ca3ffe917f31ab26d1c9ab to your computer and use it in GitHub Desktop.
part-extract.sh
SRC=$1
DIR=$SRC.ext
mkdir $DIR
eval `fdisk -l $SRC | grep ^$SRC | awk '{ print "dd if='$SRC' bs=512 of='$DIR'/"$1" skip="$2" count="$4" ; "; }'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment