It's common to use bash shell for example to bulk rename plenty files. Usually I used the following structure,
for file in ./*.short
do
# do command
done
That's for filename with .short extension. But, now how to process with two or more variable names (in this case file extension) in command? I would like to do bulk process for the following command,
( x2x +sf < data.short | frame -l 400 -p 80 | \
bcut +f -l 400 -s 65 -e 65 |\
window -l 400 -L 512 | spec -l 512 |\
glogsp -l 512 -x 8 -p 2 ;\
\
bcut +f -n 20 -s 65 -e 65 < data.mcep |\
mgc2sp -m 20 -a 0.42 -g 0 -l 512 | glogsp -l 512 -x 8 ) | xgr
In that case I have .short and .mcep that I want to process concurrently. I use the and logic (&&) but it didn't works,
for file1 in ./*.short && ./*.mcep
do
# $file1 and file2 process
done
Any experienced and skilled shell programmer want to share how to solve this? I have idea to used nested loops, but I don't know how to implemented in Bash.
.mcep
file for each.short
file? if so, you just need to loop over one and create the other by substitution e.g."${file%.short}.mcep"