#!/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
根据输出结果可以体会出上面的各种用法