From f5d5ffb7bef03013107f73170b2a1b58488c399f Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Sat, 3 Aug 2013 22:33:09 -0700 Subject: [PATCH] mp3chop-fixes Signed-off-by: Colin McCabe --- mp3chop.sh | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mp3chop.sh b/mp3chop.sh index 6af88f7..2f089f5 100755 --- a/mp3chop.sh +++ b/mp3chop.sh @@ -40,17 +40,18 @@ shift $(( OPTIND-1 )) mkdir -p "$output_dir" || die "failed to create $output_dir" for file in "$@"; do + bfile="$(basename "${file}")" absfile="$(readlink -f "${file}")" - mkdir -p "${output_dir}/${file}.dir" - pushd "${output_dir}/${file}.dir" &>/dev/null \ - || die "failed to pushd to ${output_dir}/file" + mkdir -p "${output_dir}/${bfile}.dir" + pushd "${output_dir}/${bfile}.dir" &>/dev/null \ + || die "failed to pushd to ${output_dir}/bfile" ln "$absfile" || die "failed to hardlink ${absfile}" - mp3splt -t "${segment_size}" "${file}" \ - || die "mp3splt failed on file ${file}" - rm -f "$file" + mp3splt -t "${segment_size}" "${bfile}" \ + || die "mp3splt failed on file ${bfile}" + rm -f "$bfile" mv * .. cd .. - rmdir "${file}.dir" || die "rmdir ${file}.dir failed" + rmdir "${bfile}.dir" || die "rmdir ${bfile}.dir failed" popd &> /dev/null || die "popd failed" done -- 1.6.6.rc1.39.g9a42