#!/bin/sh - # viewcolorrc - colorize a GNU-ls color configuration file with itself # Steve Kinzler, kinzler@cs.indiana.edu, Nov 98/Jun 05 # http://www.cs.indiana.edu/~kinzler/home.html#unixcfg case "$1" in -h) echo "usage: $0 [ dircolors_file ]" 1>&2; exit 1;; esac expand ${1+"$@"} | perl -ne ' $chop = chop; ($on, $off) = (/^(#\d+#)?[^#]+\s((\d\d;)*\d\d)\s*(#.*)?$/) ? ("\e[$2m", "\e[00m") : ("", ""); print $on, $_, $off, $chop;'