You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
461 B
Bash

filesize="493273331"
linecount="402"
source=$1
destination=$2
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
}
offset=`head -n $linecount "$1" | wc -c | tr -d " "`
MS_dd $source $offset $filesize | bzip2 -d | tar -xv -C $destination