Skip to content

Instantly share code, notes, and snippets.

@HaleTom
HaleTom / print256colours.sh
Last active June 29, 2024 16:16
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
# 单行注释
""" 多行字符串可以用
三个引号包裹,不过这也可以被当做
多行注释
"""
####################################################
## 1. 原始数据类型和操作符
####################################################