On Mon, Jun 20, 2022 at 09:02:13AM -0400, Greg Reagle wrote: > On Mon, Jun 20, 2022, at 3:00 AM, m...@datameer.com wrote: > > "Greg Reagle" <l...@speedpost.net> wrote: > >> ls | awk '/er.*/ {match($0, /er.*/); print $0; print > >> NR":"RSTART"-"RSTART+RLENGTH}' > > [0] https://geoff.greer.fm/ag/
you don't need match twice so awk ' match($0, /er.*/) { print $_"\n"NR":"RSTART"-"RSTART+RLENGTH }' does the trick. regards -- Marc Chantreux Direction du numérique de l'Université de Strasbourg Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200