Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Script para reconhecimento de arquivos de mídia
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Portuguese
View previous topic :: View next topic  
Author Message
Gotterdammerung
l33t
l33t


Joined: 11 Feb 2004
Posts: 627
Location: Rio de Janeiro, Brazil

PostPosted: Tue Jun 22, 2004 3:33 pm    Post subject: Script para reconhecimento de arquivos de mídia Reply with quote

Está bem básico, mas resolve um monte de problemas:

Code:

#!/bin/bash

RES=1
MIME=`file $1`

if [ `echo $MIME | egrep 'ASF|AVI|MPEG|DIVX|WMV|MPG' | wc -l` == 1 ]
then
   xine "$1" 2>/dev/null &
   RES=0
fi

if [ `echo $MIME | egrep 'JPEG|GIF|PNG|BMP' | wc -l` == 1 ]
then
   xnview -full "$1" 2>/dev/null &
   RES=-1
fi

if [ `echo $MIME | egrep 'MP3|WAV|AU|WMA' | wc -l` == 1 ]
then
   xmms -e "$1" 2>/dev/null &
   RES=-2
fi

if [ $RES > 0 ]
then
   echo "Unknown format"
fi

echo $MIME

exit $RES

_________________
A mind that is stretched by a new experience can never go back to its old dimensions. - Oliver Wendell Holmes
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portuguese All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum