3 # print mime type of file, depending on file name extension
6 echo "Usage: $0 FILE..." >&2
13 *.xls) type=application/excel;;
14 *.ppt) type=application/mspowerpoint;;
15 *.doc) type=application/msword;;
16 *.pdf) type=application/pdf;;
17 *.deb) type=application/x-debian-package;;
18 *.tar) type=application/x-tar;;
19 *.[1-9]) type=application/x-troff-man;;
20 *.zip) type=application/zip;;
21 *.au) type=audio/basic;;
22 *.gif) type=image/gif;;
23 *.jpg|*.jpeg) type=image/jpeg;;
24 *.png) type=image/png;;
25 *.ps) type=application/postscript;;
26 *.eps) type=image/eps;;
27 *.tif|*.tiff) type=image/tiff;;
28 *.ico) type=image/x-icon;;
29 *.bmp) type=image/x-ms-bmp;;
30 *.pnm) type=image/x-portable-anymap;;
31 *.pbm) type=image/x-portable-bitmap;;
32 *.pgm) type=image/x-portable-graymap;;
33 *.ppm) type=image/x-portable-pixmap;;
34 *.xbm) type=image/x-xbitmap;;
35 *.xpm) type=image/x-xpixmap;;
36 *.xwd) type=image/x-xwindowdump;;
37 *.eml) type=message/rfc822;;
38 *.rtf) type=text/richtext;;
39 *.html|*.htm) type=text/html;;
40 *.txt) type=text/plain;;
41 *.mpg|*.mpeg) video/mpeg;;
43 if file "$i" | grep -q ' text$' ; then
46 type=application/octet-stream