Skip to content

Instantly share code, notes, and snippets.

@joepie91

joepie91/.sh Secret

Created August 27, 2017 11:45
Show Gist options
  • Save joepie91/c3b5a24d256ecfd833bb6b1cfbd46ce9 to your computer and use it in GitHub Desktop.
Save joepie91/c3b5a24d256ecfd833bb6b1cfbd46ce9 to your computer and use it in GitHub Desktop.
MS_dd()
{
blocks=`expr $3 / 1024`
bytes=`expr $3 % 1024`
dd if="$1" ibs=$2 skip=1 obs=1024 conv=sync 2> /dev/null | \
{ test $blocks -gt 0 && dd ibs=1024 obs=1024 count=$blocks ; \
test $bytes -gt 0 && dd ibs=1 obs=1024 count=$bytes ; } 2> /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment