I'm running up against the "argument list too long" problem using a command in the shell (bash in my case). Most suggestions for working around this suggest using find
or some variation, presuming that it's a long list of files that is exceeding the argument length limit.
However, in my case it's not a list of files but a list of arguments. I'm using the audio processing software sox
and need to be able to use as many command line arguments as I want (depending on input audio file length). So, for example, a short version of a command I want might look like:
sox input.wav output.wav trim 0 1 gain 1 : trim 0 1 gain 2 : trim 0 1 gain 1
But instead of just three trim/gain arg pairs, I want it to go on for as long as I want (so imagine that it just keeps going with trim 0 1 gain X
.
Is there any way to write a function to generate this in order to subvert the arg length limit? I tried some variations but can't seem to figure it out.
xargs(1)
.sox
’s--effects-file
option?