[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warn about long lines
From: |
Ralph Corderoy |
Subject: |
Re: Warn about long lines |
Date: |
Tue, 23 Aug 2022 13:51:25 +0100 |
Hi Alejandro,
> > ! groff -Tutf8 -man -ww longline.man |
> > expand |
> > grep '^.\{80\}.'
>
> Ahh, I forgot about \{N\}, since I never use it.
>
> Still, the Makefile uses pipefail, so I'm not sure how to make grep(1)
> work for this. If it works, it would be nice.
Move the inversion along the pipeline with a subshell.
$ awk '{print FILENAME, length}' *
79 79
80 80
81 81
$
$ set -o pipefail
$ false | (! grep '^.\{80\}.' 79); echo $?
1
$ false | (! grep '^.\{80\}.' 80); echo $?
1
$ false | (! grep '^.\{80\}.' 81); echo $?
.................................................................................
1
$
$ true | (! grep '^.\{80\}.' 79); echo $?
0
$ true | (! grep '^.\{80\}.' 80); echo $?
0
$ true | (! grep '^.\{80\}.' 81); echo $?
.................................................................................
1
$
--
Cheers, Ralph.
- Warn about long lines, Alejandro Colomar, 2022/08/21
- Re: Warn about long lines, Ralph Corderoy, 2022/08/22
- Re: Warn about long lines, Alejandro Colomar, 2022/08/22
- Re: Warn about long lines, Ralph Corderoy, 2022/08/23
- Re: Warn about long lines, Alejandro Colomar, 2022/08/23
- Re: Warn about long lines,
Ralph Corderoy <=
- Re: Warn about long lines, Alejandro Colomar, 2022/08/24
- Re: Warn about long lines, Alejandro Colomar, 2022/08/25
- Re: Warn about long lines, Ralph Corderoy, 2022/08/26
- Re: Warn about long lines, Alejandro Colomar, 2022/08/26
- Re: Warn about long lines, Ingo Schwarze, 2022/08/27
- Re: Warn about long lines, Ralph Corderoy, 2022/08/27
- Re: Warn about long lines, Alejandro Colomar, 2022/08/27
- Re: Warn about long lines, G. Branden Robinson, 2022/08/27
- Re: Warn about long lines, Alejandro Colomar, 2022/08/28
- Re: Warn about long lines, G. Branden Robinson, 2022/08/28