hey @vaporeon_ is there a good way to parallelize the following bash script I'm using to convert FLACs to MP3s?
#!/usr/bin/env bash
find "./${1}" | while read -r file; do
case $(file -b "${file}") in
'FLAC '*)
echo "${file}"
ffmpeg -nostdin -i "${file}" -ab 320k -map_metadata 0 -id3v2_version 3 "${file%flac}mp3" -v 16
;;
*)
;;
esac
done
@wallhackio this motherfucker typed esac
@Lady @wallhackio i think file is fur a recursive directory search? otherwise yeah he overengineered it (and unreliably so at that)
@aescling @wallhackio *find. find is for that.
file is just for getting the type of the file
@Lady @wallhackio i don't think you can do it in a Makefile in a way that is reliable since files can have newlines in them but 99% of the time it would be fine so whatever
@aescling @wallhackio files cannot have newlines in them that is absurd
they can have spaces in them however,,
@Lady @wallhackio POSIX has allowed newlines in a filename since furever
@aescling @wallhackio you are the operator of your computer, not POSIX
@aescling @wallhackio (did you know that a file with the name `Icon´ followed by a carriage return is how macOS has stored folder icons since forever? 🌠)
@Lady @wallhackio no i did not
@aescling @wallhackio file is for a recursive directory search but there is no reason why you can¦t call file in a makefile