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