From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1HZqhS-0000lr-KA for garchives@archives.gentoo.org; Fri, 06 Apr 2007 15:50:07 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l36Fmt9N015978; Fri, 6 Apr 2007 15:48:55 GMT Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l36Fijv6011391 for ; Fri, 6 Apr 2007 15:44:45 GMT Received: by ug-out-1314.google.com with SMTP id z38so1272943ugc for ; Fri, 06 Apr 2007 08:44:44 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:reply-to:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:message-id; b=muRxCzNKI4jm0X5eq1DQbDX69tanF6MfIDJ29mJWKj8aMoXeSxwqHAic2TaWtgMnmOZ0MX5bUdYPZkOLRAg4GMV2lkW7FcP9hD6uPSwKc1f8A0noGrpimOwsQ/v1V697WommnXBycKMrbZMNkTzODUhihZ+wpcKUfYV3Xae4P4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:reply-to:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:message-id; b=JMJT5ph7trbGhzt4uQyoKTtSAo7mFP2UxDyQE5CfyOz54urgSiEl0szw8HEXwM4h9swLP8IJB6Xl0/usU6bVp5VZgIuNMYTjyei5voSeKma2Vpoa5X5oZLXc43VeKP/bc6gIY8WceKaA/483kxC8YEQ+M18qLda/qh7dWlIQ+6Y= Received: by 10.67.19.20 with SMTP id w20mr3058751ugi.1175874284719; Fri, 06 Apr 2007 08:44:44 -0700 (PDT) Received: from lappy.study ( [213.162.120.196]) by mx.google.com with ESMTP id m4sm4021069ugc.2007.04.06.08.44.41; Fri, 06 Apr 2007 08:44:41 -0700 (PDT) From: Mick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Why are gentoo people so in love with colorized output?!? Date: Fri, 6 Apr 2007 16:44:21 +0100 User-Agent: KMail/1.9.5 References: <20070404041739.GA15293@crowfix.com> <200704051807.36759.michaelkintzios@gmail.com> <461548D6.4050103@bredband.net> In-Reply-To: <461548D6.4050103@bredband.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2236001.x2H1jUnRcx"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200704061644.24693.michaelkintzios@gmail.com> X-Archives-Salt: c488ce95-68c6-41b8-865c-ec697ee46e68 X-Archives-Hash: 405c6594fd8ff7844d026d8a8c674483 --nextPart2236001.x2H1jUnRcx Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 05 April 2007 20:07, Tony Stohne wrote: > Mick said the following on 2007-04-05 19:07: > | ... > | Hmm, neither less not cat give me color output. Passing --color=3Dy to > > either > > | tells me things like: > | =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > | There is no color=3Dy option ("less --help" for help) > | =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > | > | I also tried --color but it's all still shown in black & white. How > > do you > > | pipe a file and get it to show in color? Am I missing something in > | my .bashrc or elsewhere? > > To make less interpret color escape sequences, you need the -R option. > export LESS=3D-R in your shell startup script and you-ll have it as > default. Generally, you don't want to use less -r, which allows > arbitrary control characters through to affect the terminal (which tend > to create major garbage). > > Color is added via ANSI escape sequences, which don't work in all > displays/terminals/consoles, but as an example: grep is smart enough to > detect this and won't use color (even when specified) if you're sending > the output via a pipeline. Otherwise, if you piped the output, eg to > less, the ANSI escape sequences would send garbage to the screen. > > ~ If, on the other hand, that's really what you want to do (without the > garbage), there's a workaround: > > use the --color=3Dalways to force it through and call less with the -R > flag (which prints ALL RAW control characters). That way, the color > codes will escape correctly and you'll page through screens of text with > your matched patterns in full color: > > grep --color=3Dalways "regexp" the_file_you_want_to_wade_through | less -R > > That should do the trick :) Thank you Tony, That's good. It shows the regexp in colour and makes it easy to find amids= t=20 the text. However, what I had in mind was many different colours, like I c= an=20 see e.g. in vim? Is such a thing possible with cat or less? BTW, I had alias less=3D"less -r" in my .bashrc, but changed to -R as sugge= sted. Happy Easter to All! =2D-=20 Regards, Mick --nextPart2236001.x2H1jUnRcx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGFmrY5Fp0QerLYPcRAkwcAKDBArKhH+4voK+IVmQmSKazm0hBfACfWjl+ BlC5rKUj+9sTYbM1NXhiJco= =hcwH -----END PGP SIGNATURE----- --nextPart2236001.x2H1jUnRcx-- -- gentoo-user@gentoo.org mailing list