karlgoethebier has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, this one should be self explaining:
karls-mac-mini:monks karl$ for i in {0..9}; do echo $i; done | perl -p +e '$_++' 12345678910karls-mac-mini:monks karl$
Ok, but i want a newline:
karls-mac-mini:monks karl$ for i in {0..9}; do echo $i; done | perl -n +e '$_++; print qq($_\n)' 1 2 3 4 5 6 7 8 9 10
Quite simple. Got it. But sometimes i struggle a little bit with the essentials :-(
So i wonder if there is a TMTOWTDI for doing something like this.
Thank you very much for any hint and best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to print a newline in oneliners ...
by karlgoethebier (Abbot) on Apr 22, 2014 at 17:02 UTC | |
|
Re: How to print a newline in oneliners ...
by Anonymous Monk on Apr 22, 2014 at 16:35 UTC | |
by GotToBTru (Prior) on Apr 22, 2014 at 17:43 UTC | |
by Anonymous Monk on Apr 22, 2014 at 19:02 UTC | |
|
Re: How to print a newline in oneliners ...
by Laurent_R (Canon) on Apr 22, 2014 at 17:37 UTC | |
by karlgoethebier (Abbot) on Apr 22, 2014 at 19:25 UTC | |
by Laurent_R (Canon) on Apr 22, 2014 at 22:41 UTC | |
by Not_a_Number (Prior) on Apr 22, 2014 at 19:25 UTC | |
by Anonymous Monk on Apr 22, 2014 at 19:31 UTC |