Created
January 3, 2015 04:57
-
-
Save yosmoc/5e035b0185bb26e7c16e to your computer and use it in GitHub Desktop.
シェルスクリプトでスペースや改行が入っているファイル処理するときには、IFSを設定する。 ref: http://qiita.com/samurai20000@github/items/7162d9bf7410b09cb5c2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| IFS=$'\n' | |
| files=$(find . -type f -name "*.mp4") | |
| for file in $files | |
| do | |
| file_without_extension=${file%.*} | |
| echo "change from "${file}" to "${file_without_extension}.mp3 | |
| ffmpeg -i $file -acodec libmp3lame -ab 64k -ac 1 ${file_without_extension}.mp3 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment