DEV Community

rafaone
rafaone

Posted on

generate media file list

Original post 23/11/2009 rafaelgimenes.net

#!/bin/bash
#gerarListaMidia.sh
#gera lista de MP3, filmes, e Bootlegs de Rock;
#2009-11-23, por rafael gimenes | falecom@rafaelgimenes.net
VERSAO="0.5";
echo "----------------------------"
echo "GerarListaMidia v$VERSAO"
echo "----------------------------"

#caminhos
caminho_mp3="/media/Tandera/_Mp3/"
caminho_filmes="/media/Tandera/_Videos/Filmes"
caminho_desenhos="/media/Tandera/_Videos/Desenhos"
caminho_showsclipes="/media/Tandera/_Videos/Musica"
caminho_arquivosaida="/home/rgimenes"

#mensagens
msg_cabecalho="Lista de arquivos de Rafael Gimenes | contato: falecom@rafaelgimenes.net"
msg_sobre="Por rafael gimenes | falecom@rafaelgimenes.net"

#funcao que gera a lista de mp3
r_gerarmp3() {
nomearquivo="listaMp3.txt"
echo $msg_cabecalho > $caminho_arquivosaida/$nomearquivo;
tree -d $caminho_mp3 >> $caminho_arquivosaida/$nomearquivo;
echo $msg_sobre >> $caminho_arquivosaida/$nomearquivo;
echo "FIM MP3";
}

#funcao que gera a lista de bootlegs
r_gerarshowsclipes() {
nomearquivo="listaShowsClipes.txt"
echo $msg_cabecalho > $caminho_arquivosaida/$nomearquivo;
tree $caminho_showsclipes >> $caminho_arquivosaida/$nomearquivo;
echo $msg_sobre >> $caminho_arquivosaida/$nomearquivo;
echo "FIM Shows e Clipes";
}

#funcao que gera os Filmes
r_gerarfilmes() {
nomearquivo="listaFilmes.txt"
echo $msg_cabecalho > $caminho_arquivosaida/$nomearquivo;
tree $caminho_filmes >> $caminho_arquivosaida/$nomearquivo;
echo $msg_sobre >> $caminho_arquivosaida/$nomearquivo;
echo "FIM Filmes";
}

#funcao que gera os Desenhos
r_gerardesenhos() {
nomearquivo="listaDesenhos.txt"
echo $msg_cabecalho > $caminho_arquivosaida/$nomearquivo;
tree $caminho_desenhos >> $caminho_arquivosaida/$nomearquivo;
echo $msg_sobre >> $caminho_arquivosaida/$nomearquivo;
echo "FIM Desenhos";
}

r_gerarfilmes;
r_gerardesenhos;
r_gerarmp3;
r_gerarshowsclipes;
echo "Arquivos gerados com sucesso";
ls $caminho_arquivosaida/*lista*;
echo "Economizou tempo :)";
Enter fullscreen mode Exit fullscreen mode

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay