#!/bin/bash function check_file() { if file "$1" |grep image 2>&1 >/dev/null; then TYPE=image elif mencoder -endpos 2 -oac pcm -ovc copy "$1" -o /dev/null >/dev/null 2>&1; then TYPE=video else TYPE=unknown fi }