Advertisement

07.22.2008 at 03:35PM PDT, ID: 23586853 | Points: 125
[x]
Attachment Details

Exclude .log files from BASH script

Asked by toben88 in Shell Scripting, Bourne-Again Shell (bash)

Tags: bash shell script

I have a BASH script that works but I need to skip over the .log files.

Here is the script - how do I get the "for movie ..."  line to exclude all .log files in that directory?

#!/bin/bash
for movie in /home/smartdata/www/html/files/encode/flv/*.* ; do
    NEWNAME=`basename $movie`
    NEWNAME="${NEWNAME%%.*}.flv"
    NEWPATH=/home/smartdata/www/html/files/encoding/flv/$NEWNAME
    FINALPATH=/home/smartdata/www/html/files/encoded/flv/$NEWNAME
    mencoder "$movie" -o "$NEWPATH" -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vf scale=416:312 -srate 22050
    mv $movie /var/www/html/files/encode/flv/finished/
    mv $NEWPATH $FINALPATH
doneStart Free Trial
[+][-]07.22.2008 at 03:52PM PDT, ID: 22064439

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 04:06PM PDT, ID: 22064509

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 04:31PM PDT, ID: 22064645

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628