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

Re: printenv color output



Hi,

On 2007-12-18 15:05 +0100, Douglas A. Tutty wrote:

> On Tue, Dec 18, 2007 at 12:45:14PM +0100, roberto wrote:
>> is there any way to let the variables printed on screen by 'printenv'
>> to be coloured in order to be easily identified ?
>> 
>> i have a large output and some variable is hardly recognized among the
>> value of the previous or the next ...
>> 
>  
> I don't see any way from the man page for /usr/bin/printenv nor from the
> bash man page.  As I see it, you have two options:
>
> 1.	Change the source for /usr/bin/printenv and its man page.
> 	Submit the changes as an enhancement.
>
> 2.	Write a script to take the output of printenv (or that runs 
> 	/usr/bin/printenv and captures the output), colourizes it as you
> 	wish and displays it.

Here is an implementation of 2., short enough to make it an alias :-):

printenv | egrep --color '^[^=]+'

Cheers,
       Sven


Reply to: