Padding zeros in a string

前端 未结 7 551
情话喂你
情话喂你 2020-12-24 10:03

I\'m writing a bash script to get some podcasts. The problem is that some of the podcast numbers are one digits while others are two/three digits, therefore I need to pad t

相关标签:
7条回答
  • 2020-12-24 11:01

    to avoid context switching:

    a="123"
    b="00000${a}"
    c="${b: -5}"
    
    0 讨论(0)
提交回复
热议问题