[Cialug] Regex Question

Tim Wilson tim_linux at wilson-home.com
Fri Oct 12 19:39:41 UTC 2018


I forgot the 4 leading spaces in front of the 1st %. That’s what I get for
doing it on one computer and typing it into an email on another.

I have another line that will figure out the length of the first indented
word. It’s rather long and is composed of several commands joined by pipes.
I’ll send it later.

On Fri, Oct 12, 2018 at 1:30 PM Todd Walton <tdwalton at gmail.com> wrote:

> On Fri, Oct 12, 2018 at 1:43 PM Tim Wilson <tim_linux at wilson-home.com>
> wrote:
>
> > Does it have to be regex? I have a short awk script that should work:
> >
> > awk ‘{if(NF > 1) {printf “%-9s %s %s\n”, $1, $2, $3} else {print $1}}’
> > <foo.txt
> >
>
> Nice.
>
> Also, jim, I don't use Perl or JavaScript. I know, I know, heresy. Turn in
> my sysadmin card. Etc.
>
> --
> Todd
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
-- 
Tim
Required reading: http://bccplease.com/


More information about the Cialug mailing list