Results 1 to 3 of 3

Thread: BASH esacping long filenames

  1. #1

    BASH esacping long filenames

    Given this BASH script to dump the audio from FLV files as mp3s it doesnt work on files with spaces in...

    How do I get it to handle space in filenames?

    Code:
    #!/bin/bash
    
    OUTPUTDIR="mp3/"
    
    for FILE in *flv; do
    
    ffmpeg -i $FILE -acodec libmp3lame -ab 256k -ac 2 -ar 44100 $OUTPUTDIR$FILE.mp3
    
    done

  2. #2
    Join Date
    Dec 2006
    Beans
    7,305

    Re: BASH esacping long filenames

    Perhaps the following small variations might help:

    Code:
    #!/bin/bash
    
    OUTPUTDIR="mp3"
    
    for FILE in *.flv; do
    
    ffmpeg -i "$FILE" -acodec libmp3lame -ab 256k -ac 2 -ar 44100 $OUTPUTDIR/"${FILE%.flv}.mp3"
    
    done
    Andrew
    You think that's air you're breathing now?

  3. #3

    Re: BASH esacping long filenames

    Bingo - Thanks mate!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •