- 论坛徽章:
- 0
|
本帖最后由 lgfang 于 2015-11-18 13:57 编辑
俄罗斯:- #!/bin/bash
- # screen size
- lines=$(tput lines)
- cols=$(tput cols)
- # flag height:width == 2:3, terminal font cell height:width=5:2(?)
- if [ $cols -gt $((lines * 15 / 4)) ]; then
- cols=$((lines * 15 / 4))
- else
- lines=$((cols * 4 / 15))
- fi
- # Do not check result size, assuming screen always big enough.
- pad=$(eval "printf ' %.s' {1..$cols}")
- rows=$(eval "echo {1..$((lines/3))}")
- for color in "\e[107m" "\e[44m" "\e[41m"; do
- for row in $rows ; do
- echo -e "${color}${pad}"
- done
- done
- echo -en "\e[0m" # restore
复制代码 法国的:- #!/bin/bash
- # screen size
- lines=$(tput lines)
- cols=$(tput cols)
- # flag height:width == 2:3, terminal font cell height:width=5:2(?)
- if [ $cols -gt $((lines * 15 / 4)) ]; then
- cols=$((lines * 15 / 4))
- else
- lines=$((cols * 4 / 15))
- fi
- # Do not check result size, assuming screen always big enough.
- # blue:white:red=1:1:1 (actual ratio 30:33:37)
- pad=$(eval "printf ' %.s' {1..$((cols / 3))}")
- rows=$(eval "echo {1..$lines}")
- for row in $rows ; do
- echo -e "\e[44m${pad}\e[107m${pad}\e[41m${pad}"
- done
- echo -en "\e[0m" # restore
复制代码 |
|