sed -r $'s/^(==>)(.*)(<==)$/\e[31m\\1\\2\\3\e[m/g'
On Wed, Jul 21, 2021, 03:17 <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"
>
>
>
> For one file I get
>
>
>
> ==> ./01cuneus/igtdr108/igtdr108.texi <==
> \input texinfo
> @set tlpage-tdr108
> @set fmatr-tdr108
>
> @c %**start of header
> @setfilename Notation.info
> @settitle Notation
> @smallbook
> @finalout
> @c %**end of header
>
> @c Org Mode Commands
> @ignore
>
>
> How can I get the file name (enclosed within ==> and <==) to be coloured
> red
>
> in the command line terminal.
>
>
>
>
>