printf3.sub
来自「android-w.song.android.widget」· SUB 代码 · 共 54 行
SUB
54 行
LC_ALL=CLANG=CSHELLSTART=$(date +%s)SECS=1275250155export TZ=EST5EDTprintf "%()T\n" $SECSprintf "%(abde)Z\n" -1printf "%(%e-%b-%Y %T)T\n" $SECSprintf -v v1 "%(%e-%b-%Y %T)T\n" $(date +%s)printf -v v2 "%(%e-%b-%Y %T)T\n" -1case $v1 in$v2) ;;*) echo "current time and -1 possible mismatch|$v1|$v2|" >&2 ;;esacunset v1 v2v1=$(date +%s)printf -v v2 "%(%s)T" -1case $v1 in$v2) ;;*) echo "current time mismatch:$v1|$v2|" >&2 ;;esacunset v1 v2printf "%(%x %X)T\n" $(( $SECS - 3600 ))printf -v v1 "%(%F %r)T\n" $SHELLSTARTprintf -v v2 "%(%F %r)T\n" -2case $v1 in$v2) ;;*) echo "shell start time and -2 possible mismatch|$v1|$v2|" >&2 ;;esacunset v1 v2printf "current time: %(%F %r)T\n" $SECSprintf "epoch time: %(%F %r %z)T\n" 0printf "random time: %(%F %r %z)T\n" $SECSprintf "local time: %(%a %b %e %H:%M:%S %Z %Y)T\n" $SECS# test fieldwidth, justification, precisionprintf "%-40.50(%a %b %e %H:%M:%S %Z %Y)T date-style time\n" $SECS# test fieldwidth, justification, precision, embedded parensprintf "%-40.50(%x (foo) %X)T date-style time\n" $SECS
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?