#! /bin/bash

test $# = 2 || {
    cat <<EOF
Usage: $0 x.fastq y.fastq
or:    $0 x.fastq.gz y.fastq.gz

Read 2 fastq files, and write them interleaved.
Assumes 1 fastq per 4 lines, i.e. no line wrapping.
EOF
    exit
}

paste <(gzip -cdf "$1" | paste - - - -) <(gzip -cdf "$2" | paste - - - -) |
    tr '\t' '\n'
