Range with leading zero in bash

前端 未结 5 1544
慢半拍i
慢半拍i 2020-12-31 03:06

How to add leading zero to bash range?
For example, I need cycle 01,02,03,..,29,30
How can I implement this using bash?

5条回答
  •  我在风中等你
    2020-12-31 03:44

    another seq trick will work:

     seq -w 30
    

    if you check the man page, you will see the -w option is exactly for your requirement:

    -w, --equal-width
                  equalize width by padding with leading zeroes
    

提交回复
热议问题