SPRINTF in shell scripting?

后端 未结 3 1276
时光取名叫无心
时光取名叫无心 2020-12-24 05:26

I have an auto-generated file each day that gets called by a shell script. But, the problem I\'m facing is that the auto-generated file has a form of:

FIL         


        
3条回答
  •  情深已故
    2020-12-24 06:03

    Why not using the printf program from coreutils?

    $ printf "FILE_%02d_%02d.dat" 1 2
    FILE_01_02.dat
    

提交回复
热议问题