diff --git a/episodes/04-redirection.md b/episodes/04-redirection.md index de710a20..6814cc2c 100644 --- a/episodes/04-redirection.md +++ b/episodes/04-redirection.md @@ -236,6 +236,23 @@ $ wc -l SRR098026.fastq Now you can divide this number by four to get the number of sequences in your fastq file. +This can be done using [shell integer arithmetic](https://www.gnu.org/software/bash/manual/html_node/Shell-Arithmetic.html) + +```bash +$ echo $((996/4)) +``` + +Note, this will do integer division - if you need floating point arithmetic you can use [bc - an arbitrary precision calculator](https://www.gnu.org/software/bc/manual/html_mono/bc.html) + + +```bash +$ echo "996/4" | bc +``` + +```output +249 +``` + ::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::