help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing in red during output from head


From: Chris Elvidge
Subject: Re: Printing in red during output from head
Date: Wed, 21 Jul 2021 16:48:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 21/07/2021 02:50 pm, lisa-asket@perso.be wrote:
I am almost there, but I am having the problom with the \e



     find "$fdir" -type f -name "*.org" -o -name "*.texi"  \
       | xargs head -n "$n"                                \
       | sed -e 's/==>/^\e[01;31m==>/;s/<==/<==^\e[0m/'

Instead of typing ^\e, press Ctrl-V and then Esc

From: Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
To: Chris Elvidge <celvidge001@gmail.com>
Subject: Re: Printing in red during output from head
Date: 21/07/2021 13:55:43 Europe/Paris
Cc: help-bash <help-bash@gnu.org>

shopt -s extglob dotglob globstar
gawk -f my_too_big_thing -v ml=5 **/*@(.@(texi|org))

btw for esc \33 or sometimes \e

On Wed, Jul 21, 2021 at 1:48 PM Chris Elvidge <celvidge001@gmail.com> wrote:

On 21/07/2021 02:17 am, lisa-asket@perso.be wrote:
I am using the following command to output the first n lines of matched files.



find "$fdir" \( -name \*.org -o -name \*.texi \) | xargs head -n "$n"


How about:
find "$fdir" -type f -name "*.org" -o -name "*.texi" | xargs head -n
"$n" | sed -e 's/==>/^[[01;31m==>/;s/<==/<==^[[0m/'

Where ^[ is escape (ctrl-v esc)

--
Chris Elvidge
England







--
Chris Elvidge
England




reply via email to

[Prev in Thread] Current Thread [Next in Thread]