help-bash
[Top][All Lists]
Advanced

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

Re: colored verbose


From: lacsaP Patatetom
Subject: Re: colored verbose
Date: Wed, 8 Nov 2023 15:02:38 +0100

Le mer. 8 nov. 2023 à 14:58, alex xmb sw ratchev <fxmbsw7@gmail.com> a
écrit :

>
>
> On Wed, Nov 8, 2023, 2:49 PM lacsaP Patatetom <patatetom@gmail.com> wrote:
>
>> Le mer. 8 nov. 2023 à 14:10, alex xmb sw ratchev <fxmbsw7@gmail.com> a
>> écrit :
>>
>>> another candidate , using xtracefd
>>> it seems work perfect
>>> just cant copypaste
>>>
>>> greets
>>>
>>> On Wed, Nov 8, 2023, 11:27 AM lacsaP Patatetom <patatetom@gmail.com>
>>> wrote:
>>>
>>>> hi,
>>>>
>>>> is it possible to distinguish the lines displayed by bash's verbose
>>>> mode by
>>>> coloring them ?
>>>>
>>>> for example, with this little script, make the first and third displayed
>>>> lines stand out by coloring them :
>>>>
>>>> bash -v <<~~~
>>>> echo hello world
>>>> seq 5
>>>> ~~~
>>>> echo hello world
>>>> hello world
>>>> seq 5
>>>> 1
>>>> 2
>>>> 3
>>>> 4
>>>> 5
>>>>
>>>> I can color script comments by adding control characters (#\[1;34m
>>>> colored
>>>> comment\[0m) that are executed when a comment is displayed, but it's not
>>>> very practical or aesthetic...
>>>>
>>>> regards, lacsaP.
>>>>
>>>
>> thank you !
>> we come very close with these few lines of code using BASH_XTRACEFD
>> (which must however be placed after the call to exec).
>>
>
> sure thing mate
> btw for me it ran
> the echo ed foo was first , but then two texted came
> as for two cmds
> then exit .. maybe u have old bash ? :)
>
> greets
>

GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)


reply via email to

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