[Cialug] Display file contents either with less or cat based on number of lines

Paul Gray gray at cs.uni.edu
Tue Oct 25 09:30:59 CDT 2011


On 10/25/2011 09:21 AM, Scott Prader wrote:
> Could probably write a wrapper for cat (maybe call it dog) and have it
> reference /etc/mine.types and/or the file command so that once it
> understands the 'scent' of the file, it will know how to process the
> file based off of the preferred application for it.  For instance, if
> you ran the command:
>
> dog kitty.jpg
>
> , it should know to figure out that it's an image file (file kitty.jpg),
> check the environment (is ${DISPLAY} set?), figure out which application
> to use (cross reference with mime.types depending on the environment),
> and run the appropriate command to display the image.

On a Mac, isn't this just the "open" command?

-- 
Paul Gray                                         -o)
314 East Gym, Dept. of Computer Science           /\\
University of Northern Iowa                      _\_V
  Message void if penguin violated ...  Don't mess with the penguin
  No one says, "Hey, I can't read that ASCII attachment ya sent me."


More information about the Cialug mailing list