I defined the following BASH function to count the number of reads in fastq:
fastq_countGzReads() { zcat "$1" | echo $((`wc -l`/4)) ; }
Now I want to apply this function to a number of gz files found with find.
find . -iname "*gz" -exec sh fastq_countGzReads {} ;
Error:
sh cannot open fastq_countGzReads
How to apply a BASH function on a selection of gz files in a directory ?