Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dvinciguerra/700682c7755ad14ad774d425141a662b to your computer and use it in GitHub Desktop.
Save dvinciguerra/700682c7755ad14ad774d425141a662b to your computer and use it in GitHub Desktop.
Perl one-liner strings replace
first=$1
second=$2

# Replace
find -name *.cpp -or -name *.h | xargs grep "$first" -l  | xargs perl -pi -e "s/$first/$second/g"

a=getDefaultIncludes; b=get_include_dirs_def; find -name "*.py" -or -name "SC*" | xargs grep "$a" -l  | xargs perl -pi -e "s/$a/$b/g"

a=abc; b=def; find -name "*.cpp" -or -name "*.h" | xargs grep "$a" -l  | xargs perl -pi -e "s/$a/$b/g"

a=; b=; find -name "*.py"  | xargs grep "$a" -l  | xargs perl -pi -e "s/$a/$b/g"

On Ubuntu, I use avconv on the command line

avconv -i input.m4a output.wav

This can do every M4A in a directory, combined with a for loop

for f in *.m4a; do avconv -i "$f" "${f/%m4a/wav}"; done

You can use exactly the same syntax for ffmpeg, except every instance of avconv with ffmpeg.

I believe that WinFF, a GUI for ffmpeg, can do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment