QUOTE(wKkaY @ Jul 13 2018, 06:49 PM)
First, run the shell script with "bash -x" to show the executed commands after string expansion. Is it executing what you expect?
wow TIL there is this dank thing bash -x haha. neat.
start with what I have in directory, which is a flac CD image, and a corresponding .cue file.
CODE
root@kujira:~/downloads/Avril Lavigne - The Best Damn Thing# ls
Avril Lavigne - The Best Damn Thing.cue Avril Lavigne - The Best Damn Thing.flac
root@kujira:~/downloads/Avril Lavigne - The Best Damn Thing#
with debug on, I run the command directly, which got parsed and executed as expected.
CODE
root@kujira:~/downloads/Avril Lavigne - The Best Damn Thing# for i in *.cue; do shnsplit -f "$i" -t %n-%t -o flac "${i%.*}.flac"; done
+ for i in *.cue
+ shnsplit -f 'Avril Lavigne - The Best Damn Thing.cue' -t %n-%t -o flac 'Avril Lavigne - The Best Damn Thing.flac'
shnsplit: warning: discarding initial zero-valued split point
Splitting [Avril Lavigne - The Best Damn Thing.flac] (40:37.50) --> [01-Girlfriend.flac] (3:37.05) : 100% OK
Splitting [Avril Lavigne - The Best Damn Thing.flac] (40:37.50) --> [02-I Can Do Better.flac] (3:17.07) : 88%
..
..
root@kujira:~/downloads/Avril Lavigne - The Best Damn Thing#
Now, I put the same command in executable file /bin/split
and run the file, the debug doesn't go further than just showing which file in /bin gets executed however.
Just that, no further output, no work done past this point.
CODE
root@kujira:~/downloads/Avril Lavigne - The Best Damn Thing# split
+ split
The similar file containing similar command to encode to opus, I put in /bin/convert
CODE
for i in *.*; do opusenc --vbr --bitrate 32 --comp 10 --expect-loss 0 "$i" "${i%.*}.opus"; done
work just fine.
CODE
root@kujira:~/downloads/Avril Lavigne - The Best Damn Thing# convert
+ convert
Encoding using libopus 1.2~alpha2 (audio)
-----------------------------------------------------
Input: 44.1kHz 2 channels
Output: 2 channels (2 coupled)
20ms packets, 32kbit/sec VBR
Preskip: 312
[/] 13% 00:05:16.89 52.8x realtime, 30.65kbit/s^