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: Greg Wooledge
Subject: Re: Printing in red during output from head
Date: Thu, 22 Jul 2021 13:19:46 -0400

On Thu, Jul 22, 2021 at 06:10:43PM +0100, Chris Elvidge wrote:
> On 22/07/2021 05:55 pm, lisa-asket@perso.be wrote:
> > Could things be made to work with tput ?
> 
> find "$fdir" -type f -name "*.org" -o -name "*.texi" | \
>       xargs head -n "$n" | \
>       sed -r $"s/^==>.*<==$/$(tput bold; tput setaf 1)&$(tput sgr0)/"
> 
> seems to work
> (Note " not ')

You want "..." not $"..." here.  $"..." quoting invokes the deprecated
localization features, which are not being used here.

The switch from single quotes to double quotes was mentioned earlier in
this thread.  We're starting to see duplicated questions and duplicated
answers already.  It's pretty disheartening.



reply via email to

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