Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、01.pdf 02.pdf などの複数のファイルがあります
bash スクリプトで for ループを作成して curl を使用しましたが、1.pdf 2.pdf などをダウンロードしようとしました。
これに対する解決策はありますか?
printfファイル名のパディングに使用できます。
printf
urlbase='http://myhost.com/path/files' for i in {1..10}; do fname=$(printf "%02d.pdf\n" $i) curl -o $fname "$urlbase/$fname" done