I was using printf to format a number in bash:
$ printf -- ">>%4d
" 1
>> 1
This works fine, but when i do the same thing in a subshell:
$ echo $(printf -- ">>%4d
" 1)
>> 1
Why are the spaces removed? I have absolutely no idea.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…