ascii.sh
来自「Shall高级编程」· Shell 代码 · 共 39 行
SH
39 行
#!/bin/bash# ascii.sh# Script by Sebastian Arming.# Lightly modified by ABS Guide author.# Used with permission (thanks!).exec >ASCII.txt # Save stdout to file, #+ as in the example scripts #+ reassign-stdout.sh and upperconv.sh.MAXNUM=256COLUMNS=5OCT=8OCTSQU=64LITTLESPACE=-3BIGSPACE=-5i=1 # Decimal countero=1 # Octal counterwhile [ "$i" -lt "$MAXNUM" ]; do paddi=" $i" echo -n "${paddi: $BIGSPACE} " # Column spacing. paddo="00$o" echo -ne "\\${paddo: $LITTLESPACE}" echo -n " " if (( i % $COLUMNS == 0)); then # New line. echo fi ((i++, o++)) # The octal notation for 8 is 10 and 80 -> 100. (( i % $OCT == 0)) && ((o+=2)) (( i % $OCTSQU == 0)) && ((o+=20)) # We don't have to count past 0777.doneexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?