Skip to content

Instantly share code, notes, and snippets.

@briansorahan
Created June 17, 2014 19:49
Show Gist options
  • Save briansorahan/4e53aa6eb80a18a3dfe4 to your computer and use it in GitHub Desktop.
Save briansorahan/4e53aa6eb80a18a3dfe4 to your computer and use it in GitHub Desktop.
copy files from a sony pcmd50 and fix the file extensions
#!/bin/bash
#
# Copy audio files from a Sony PCM-D50 and
# change the file extension from .WAV to .wav
#
function main {
local src=/media/brian/PCMRECORDER
local dst=.
if [ $# -ge 1 ]; then
src="$1"
fi
if [ $# -ge 2 ]; then
dst="$2"
fi
local newname=
for f in $(find $src -name '*.WAV'); do
newname=$dst/$(basename ${f/%.WAV/.wav})
cp $f $newname
done
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment