Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- info=$(python python_list_remote_zip.py "$1" | grep -m 1 -A 5 "^$2\$" | tail -n +2)
- tmpfile=$(mktemp)
- wget -q --start-pos $(echo "$info" | grep offset | grep -o '[[:digit:]]*') -O - "$1" | head -c $(echo "$info" | grep -m 1 length | grep -o '[[:digit:]]*') >"$tmpfile"
- #printf '\x1f\x8b' # gzip magic
- #tail -c +9 <"$tmpfile" | head -c 1 # copy compression method
- #printf '\0\0\0\0\0\0\x03' # some flags and mtime
- tail -c "+$(expr 1 + $(echo "$info" | grep header | grep -o '[[:digit:]]*'))" <"$tmpfile"
- #tail -c +15 <"$tmpfile" | head -c 4 # The CRCs seem to be compatible.
- #tail -c +23 <"$tmpfile" | head -c 4
- rm "$tmpfile"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement