summaryrefslogtreecommitdiffstats
path: root/flactomp3
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-31 14:42:30 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-31 14:42:30 +0200
commit0582c9f9b114702e7a5a3a12339b46d71ba4fec1 (patch)
treeeea27b5195b5a9f3962dd2f2c09ada9fc9fc77d3 /flactomp3
parent11e07553ec15b03fd38f4549010e78c0e7bf5f20 (diff)
downloadbin-0582c9f9b114702e7a5a3a12339b46d71ba4fec1.tar.gz
bin-0582c9f9b114702e7a5a3a12339b46d71ba4fec1.tar.xz
flactomp3: fix directory creation
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'flactomp3')
-rwxr-xr-xflactomp34
1 files changed, 2 insertions, 2 deletions
diff --git a/flactomp3 b/flactomp3
index 32ed2e3..1edcfb4 100755
--- a/flactomp3
+++ b/flactomp3
@@ -15,5 +15,5 @@ fi
dir=${1%/}
copydir_suffix="_mp3"
-find "$dir" -type d -exec mkdir -p ${dir}${copydir_suffix}/{} +
-find "$dir" -type f -name '*.flac' -print0 | parallel -0 ffmpeg -i {} -qscale:a 0 '{=s#^([^/])(.*)\.flac$#\1'"${copydir_suffix}"'\2.mp3#=}'
+# same regex twice, but different replacement pattern
+find "$dir" -type f -name '*.flac' -print0 | parallel -0 echo mkdir -p '{=s#^([^/]+)(.*)/([^/]+)\.flac$#\1'"${copydir_suffix}"'\2#=}'\; echo ffmpeg -i {} -qscale:a 0 '{=s#^([^/]+)(.*)/([^/]+)\.flac$#\1'"${copydir_suffix}"'\2\3.mp3#=}'