boomwu

关注

shell脚本之格式化输出

boomwu

关注

阅读 38

2022-06-06

#!/bin/bash
printf "%d %s\n" 1 "abc"
printf '%d %s\n' 1 "abc"
printf %s "abc"
printf %s abc def
printf %d 1
printf "%s\n" abc def
printf "%s %s %s\n" 1 a b c d e f g h i
printf "%s and %d \n"

输出结果:
1 abc
1 abc
abcabcdef1abc
def
1 a b
c d e
f g h
i
and 0
根据输出结果可以体会出上面的各种用法

 


相关推荐

简单聊育儿

shell脚本之格式化输出对象

简单聊育儿 28 0 0

禾木瞎写

shell脚本格式化输出/etc/passwd文件内容

禾木瞎写 77 0 0

狗啃月亮_Rachel

[Shell脚本]字典、列表、JSON格式化

狗啃月亮_Rachel 67 0 0

吃面多放酱

《懒人Shell脚本》之二——语料库的格式化输出

吃面多放酱 32 0 0

贵州谢高低

centos之格式化输出 printf

贵州谢高低 45 0 0

非衣所思

格式化输出%:使用%%

非衣所思 157 0 0

mjjackey

python格式化输出

mjjackey 151 0 0

止止_8fc8

pythonxml格式化输出

止止_8fc8 159 0 0

海滨公园

python 格式化输出

海滨公园 102 0 0

金刚豆

go 格式化输出

金刚豆 138 0 0

精彩评论(0)

0 0 举报