help-bash
[Top][All Lists]
Advanced

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

Printing in red during output from head


From: lisa-asket
Subject: Printing in red during output from head
Date: Wed, 21 Jul 2021 19:12:11 +0200 (CEST)

Actually I am happy with using



      find "$fdir" -type f -name "*.org" -o -name "*.texi"  \
        | xargs tail -n "$m"                                \
        | grep --color -e ^ -e '^==>.*' 



Am quite pragmatic, meaning I don't have a problem changing the original plan.



From: Greg Wooledge <greg@wooledge.org>
To: help-bash@gnu.org
Subject: Re: Printing in red during output from head
Date: 21/07/2021 18:58:23 Europe/Paris

On Wed, Jul 21, 2021 at 06:41:59PM +0200, lisa-asket@perso.be wrote:
> Have also tried to use `tput` but has not worked
> 
>     find "$fdir" -type f -name "*.org" -o -name "*.texi"  \
>       -exec head -n "$n" {} \+                            \
>       | sed -e 's/==>/$(tput setaf 1)==>/;s/<==/<==$(tput sgr0)/'

Command substitutions are not performed inside single quotes. Changing
them to double quotes may work, but you'll need to double-check
everything else in the sed program to see whether it will work as
expected inside double quotes.




reply via email to

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