标签:
thatsit:~ # seq 1 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 thatsit:~ #
thatsit:~ # seq -s " " 1 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 thatsit:~ #
# 使用等宽参数
thatsit:~ # seq -w -s " " 1 20 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 thatsit:~ #
thatsit:~ # printf ‘%g ‘ `seq 1 20` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 thatsit:~ #
八进制:
thatsit:~ # printf ‘%o ‘ `seq 1 20` 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22 23 24 thatsit:~ #
十六进制:
thatsit:~ # printf ‘%x ‘ `seq 1 20` 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 thatsit:~ #
两位数精度的浮点数:
thatsit:~ # printf ‘%.2f ‘ `seq 1 20` 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 thatsit:~ #
四位数精度的浮点数:
thatsit:~ # printf ‘%.4f ‘ `seq 1 20` 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 thatsit:~ #
others
此外还有一些科学计数法等格式,一般用不到,了解下即可:
标签:
原文地址:http://www.cnblogs.com/thatsit/p/5523198.html