#!/bin/bash # summarise.sh -- number of samples and peak algae density of one run set -euo pipefail file="$1" n=$(( $(wc -l < "$file") - 1 )) peak=$(sort -t, -k2 -n "$file" | tail -1 | cut -d, -f1,2) echo "$file: $n samples, peak (day,algae) $peak"