#!/usr/bin/perl -w ########################################################### ## Grays stdout, leaving stderr nice and visible ## (this will only work on some terminal/shell combinations) ## Usage: gray [FILE...] ## or: COMMAND |gray # gray 1.0, Copyright (c) 2003, by Adam Katz , GPL ########################################################### if ((defined($ARGV[0])) && ($ARGV[0] =~ /^--*h/)) { print "Usage: gray [FILE...]\n"; exit 0; } while(<>) { chomp; # color line gray, show contents, then leave the line normal (and end it) print("\033[1;30m", $_, "\033[0;38m\n"); } exit 0; # test with this call from bash: # (echo stdout;sleep 1;echo stderr>&2;sleep 1;echo stdout)|gray