in reply to How to print a newline in oneliners ...

Why don't you do everything in Perl? Something like this:
$ perl -le 'print ++$_ for 0..9;' 1 2 3 4 5 6 7 8 9 10

Replies are listed 'Best First'.
Re^2: How to print a newline in oneliners ...
by karlgoethebier (Abbot) on Apr 22, 2014 at 19:25 UTC
    "Why don't you do everything in Perl?"

    Thank you very much Laurent for answering.

    Sure, you are right.

    But the bash code on the left side of the pipe (for i in {0..9}; do echo $i; done) wasn't the "essential" part of the question.

    The question was just about adding a newline to my Perl output.

    As i mentioned in my OP, i sometimes miss some "essentials".

    In this case the -l switch.

    To be honest, i wondered many times why some folks use -l in oneliners.

    In other words: just yet another D'oh.

    Best regards (et à bientôt), Karl

    «The Crux of the Biscuit is the Apostrophe»

      I think most of us sometimes miss some "essentials". At least, this includes me...
Re^2: How to print a newline in oneliners ...
by Not_a_Number (Prior) on Apr 22, 2014 at 19:25 UTC

    Yeah, that's what I was wondering. What about:

    perl -E 'say for 1..10'

    Update: I hadn't seen karlgoethebier's answer to Laurent_R when I posted this...

      It's good, but -E doesn't work on the old Perls that are still around. Instead of trying to remember what the Perl version on the current system happens to be, or asking people what version of Perl they're running before giving them a one-liner to use, I've just gotten in the habit of staying backwards compatible and writing perl -le 'print for 1..10'