Newlines

TL;DR

A tiny, tiny shell utility.

Many (well, most) times I get a compilation error in my Perl/Raku programs. You know, a syntax error here, a mistyped variable name there…

Fact is that I don’t have a very fancy command line prompt, so it tends to drown between an error message from a previous invocation and the following one, making it hard to see where the latest errors are.

My very basic solution to this is to hit the RETURN key a few times, so that I can see where the “hole” is. Until some time ago, when I decided it was enough and thought of this very basic solution, installed as ~/bin/newlines:

#!/bin/sh
printf '\n\n\n\n\n\n\n'
exec "$@"

It just expects to be pre-pended to whatever command line I have to type: it will print the newlines within the first command (if it’s a pipeline) and then hand it completely over to the command itself. So, now, I can write:

newlines perl -c whatevah.pl

and get some handy newlines before my… compilation errors.

Stay safe!


Comments? Octodon, , GitHub, Reddit, or drop me a line!