我怎麼能多次運行相同的代碼?例如12次?如何運行多時間相同的代碼中的Bash
sed -n 1,1p 00-02.txt | sed -e 's/^/<video length="-1" src="mp4:/' \
-e 's/$/" start="0"><\/video>/' >>playlist.txt
echo -e "$(sed -e '1,1d' 00-02.txt)\n" > 00-02.txt
cat 00-02.txt | sed '/^$/d' >> 00-02a.txt
rm 00-02.txt
mv 00-02a.txt 00-02.txt
sed -n 1,1p spot.txt | sed -e 's/^/<video length="-1" src="mp4:/' \
-e 's/$/" start="0"><\/video>/' >>playlist.txt
echo -e "$(sed -e '1,1d' spot.txt)\n" > spot.txt
cat spot.txt | sed '/^$/d' >> spota.txt
rm spot.txt
mv spota.txt spot.txt
所有代碼belove必須複製N次
像
for n in {1..12}; **ALL THE COMMANDS BELOVE**; done
但它不爲命令的多行工作。
任何問題?
我應該在工作for循環,你能解釋一下你的意思由不爲多行工作?你有錯誤還是你得到錯誤的結果? – Ajay
謝謝@Ajay解答下面的答案。 –