comparison bin/ix.sh @ 88:464d2dfb99c9

new
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 13 Apr 2021 17:02:09 +0000
parents
children 90f8f28b2e51
comparison
equal deleted inserted replaced
87:b6a5999d8e06 88:464d2dfb99c9
1 #!/usr/bin/bash
2 # Extract records from warc files given filename, length and offset triples
3 # from stdin or as command line args
4 if [ -n "$1" ]
5 then
6 printf "%s\t%s\t%s\n" "$1" "$2" "$3"
7 else
8 cat
9 fi | \
10 while { IFS=$'\t' read f l o; }
11 do
12 dd if="$f" of=/dev/stdout skip=$o count=$l iflag=skip_bytes,count_bytes
13 done | unpigz -dp 1 -c