Assaf Gordon <[email protected]> writes: > Perhaps the following will suffice? > > $ { seq 1 10; seq 12 22; seq 26 34; } | awk 'A&&(A+1)!=$1 {print} 1 > {A=$1}' > 12 > 26 > > Or, if you want to print the first value as well: > > $ { seq 1 10; seq 12 22; seq 26 34; } | awk 'NR==1{print} > A&&(A+1)!=$1{print} 1{A=$1}' > 1 > 12 > 26
Nice tips, thanks! However, the awk expressions look a bit non-trivial to me (it partly re-implements the uniq's loop), and I miss other uniq options (--group and --count) which can be used together. Regards, -- Daiki Ueno
