Linux.com

CLI Magic: A little script to customize directory listings

Posted by: Anonymous [ip: 84.240.48.164] on December 11, 2007 03:20 PM
I was searching all over the web for something like "|grep --color=auto", but without the grep part. No luck.

So i wrote this:



#!/bin/sh

#

while read line

do

echo -e `echo $line | sed 's/'"$1"'/\\\E[31m'"&"'\\\E[37m/g'`

done



And saved it as /usr/local/bin/clr

Try to pipe something through it :)
[Modified by: Anonymous on December 11, 2007 03:24 PM]

#

Return to CLI Magic: A little script to customize directory listings