![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Type I and Type II Errors - The Heart of Event Processing | iBot | Complex Event Processing RSS News | 0 | 12-05-2007 06:50 PM |
| array type has incomplete element type | jaganadh | High Level Programming | 1 | 07-24-2007 03:54 AM |
| Human readable type vs MIME type detection using file | spauldingsmails | Shell Programming and Scripting | 0 | 03-22-2007 12:43 AM |
| Lynx - Downloading - extension handling - changing mime type? | yitzle | UNIX for Dummies Questions & Answers | 2 | 10-17-2006 11:46 PM |
| How to Set Mime type to mailx | suneel | UNIX for Advanced & Expert Users | 1 | 07-08-2003 11:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Retrieving File's Mime-type
Alright, so I am trying to use perl (or any other shell scripting language, awk/sed/bash for instance), to retrieve the mime-type of a file.
I want to keep it in one file, and most of the modules that are on cpan that check for mime types (Magic), aren't installed on these boxes. Anyone have a good way of checking for a file's mime type? |
|
||||
|
If you have the .pm file for mime type checking (for example like Lite.pm for mime::lite)
you do not necessarily have to "install" the module. Just put it in your directory on the machine you are using, say /home/Rhije/Lite.pm and add this to the shebang in the top of your own perl code Code:
#!/bin/perl -I/home/Rhije/Lite.pm |
|
||||
|
Sorry, not sure if I called it the correct thing. I meant the content type, such as image/*
I am trying to find what type of file it is, image, video, script, etc.. |
| Sponsored Links | ||
|
|