This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "smart cat" -- and an awesome acronym | |
# shell function which will try and use | |
# zcat or bzcat on the filename if provided | |
# add to your .bash_profile or whatever | |
# example: scat file1.txt file2.gz file3.bz2 | grep "something useful" | |
scat() | |
{ | |
for FILE in $@; do | |
MIME=$(file -bi $FILE) | |
case $MIME in |