#!/usr/bin/awk -f # HP 2013-07-29 # HP 2019-07-06 using $0, ignoring 1st line # HP 2019-07-06 print FIRST & LAST, options for position of counter # HP 2021-11-23 check for increase # usage: # ls img_????.jpg | chkcntposinc # ls Track_*.gpx | chkcntposinc sta=7 len=3 BEGIN { sta = 5 len = 4 } { prv = cur cur = $0 if (NR >= 1 && substr(prv,sta,len)+0 >= substr(cur,sta,len)+0) { print "NOT INC: " prv " -> " cur } } #--