I've got this bash one-liner , it runs fine on OSX, but doesn't on Linux, I'm suspecting the linux distro (Busybox) on my Qnap has got something to do with this .
Here is the command that runs on OSX :
find . -type f -name "*.mp4" -exec bash -c 'ffmpeg -i "$0" -c:v copy -c:a libfaac -af "volume=23dB" "fix/$0"' '{}' \;
Now on the Qnap:
find . -type f -name "*.mp4" -exec bash -c 'ffmpeg -i "$0" -c:v copy -c:a libfaac -af "volume=23dB" "fix/$0"' '{}' \;
returns :
BusyBox v1.01 (2015.05.21-17:32+0000) multi-call binary
Usage: find [PATH...] [EXPRESSION]
Search for files in a directory hierarchy. The default PATH is the current directory; default EXPRESSION is '-print'
EXPRESSION may consist of: -follow Dereference symbolic links. -name PATTERN File name (leading directories removed) matches PATTERN. -print Print (default and assumed).
-type X Filetype matches X (where X is one of: f,d,l,b,c,...) -perm PERMS Permissions match any of (+NNN); all of (-NNN); or exactly (NNN) -mtime TIME Modified time is greater than (+N); less than (-N); or exactly (N) days
Like if the find command wasn't working, so if I execute the find command alone :
find . -type f -name "*.mp4"
it works just fine, I get all my files, so I suspect the problem is passing the files to the exec command, and that's where I can't figure it out
bash version osx : GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
bash version linux : GNU bash, version 3.2.57(1)-release (i686-pc-linux-gnu)
-exec
into a separate script would probably be a good starting point. By keeping the pieces simple, you can pinpoint the limitations to work around one-by-one.