In a Unix (or deviant thereof) system, if you don't re-invent
something, you're not having fun.

Mind you, there will be those who have done this a long time ago,
already, but you didn't know about it.

(laughs)

BT, DT.

Never be afraid to play with "new" ideas.

- soup

On Fri, Nov 14, 2008 at 12:11 PM, John McKown <[EMAIL PROTECTED]> wrote:
> I just had to post this. Sorry if it is stupid. I just write a little
> shell function which was inspired by a Tech Tip on page 56 of the Dec 2008
> Linux Journal magazine. I call it "smart_cat" because it does the
> equivalent of a "cat" command, but invokes the appropriate command based
> on the last qualifier of the input file name to, hopefully, properly
> process the file (e.g. uncompress it). I source this in my .bashrc
> file.
>
> function smart_cat()
> {
>        local i
>        for i in "$@";do
>                case "$i" in
>                        *.gz) zcat "$i"
>                        *.bz2) bzcat "$i"
>                        *.lzma) lzcat "$i"
>                        *.Z) zcat "$i"
>                        *) cat "$i"
>                esca
>        done
> }


--
John R. Campbell         Speaker to Machines          souperb at gmail dot com
MacOS X proved it was easier to make Unix user-friendly than to fix Windows

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to