#!/usr/bin/env bash # Give file as option 1 file="$1" increasing=0 last=99999999 while read line; do if [ "$line" -gt "$last" ]; then increasing="$(( increasing + 1 ))" fi last="$line" done < <(cat "$file") echo "$increasing were increasing"