in reply to how to find the length of any line of file
going into a completely different direction, a one-liner doing the job:
$ echo 'heaven > heavenly > heavenns > abc > heavenns > heavennly' | perl -nE 'BEGIN {$nr = shift;} chomp; say length $_ i +f $. == $nr;' 4 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to find the length of any line of file -- oneliner
by Discipulus (Canon) on Nov 23, 2017 at 08:52 UTC | |
by Laurent_R (Canon) on Nov 23, 2017 at 10:51 UTC | |
by Discipulus (Canon) on Nov 23, 2017 at 11:12 UTC |