I am getting empty bam files while using the following command. Any help is very much appreciated. Part of the output is also shown.
$ bwa mem -t 8 hg19.fa xxx_Q30_trim.fastq.gz | samtools view -bS - | samtools view -b -q 30 - | samtools sort - > xxx.bam
[bam_header_read] EOF marker is absent. The input is probably truncated.
Usage: samtools sort [options] <in.bam> <out.prefix>
Options: -n sort by read name -f use <out.prefix> as full file name instead of prefix -o final output to stdout -l INT compression level, from 0 to 9 [-1] -@ INT number of sorting and compression threads  -m INT max memory per thread; suffix K/M/G recognized [768M]
[M::bwa_idx_load_from_disk] read 0 ALT contigs