有人对如何将此命令转换为单行命令有任何指导或建议吗?我需要将其保留在终端命令中,而不要使用shell。非常感谢您的帮助和指导。
for event in */; do
(
echo "$event"
cd "$event"
for segment in */; do
(
cd "$segment"
echo "$segment"
for f in *-0.ts; do
(
echo $f
)
done
(printf "file '$PWD/%s'\n" *.ts | sort -n -k1.$(($(printf "file '$PWD/$f'" | wc -c) - 4))) > fraglist.txt
../../ffmpeg -f concat -i fraglist.txt -c copy ../../"${segment[@]%.hls/}.ts"
)
done
)
done
我尝试了以下类似的方法,但是结果不一样
for s in *.*; do ffmpeg -f concat -i <(for f in $s/*.ts; do echo 'file '$PWD/$f''; done) -c copy ${s[@]%.hls/}.ts; done