printf "\\$(printf '%03o' "65")"
A
for i in {a..z}; do echo $(printf "%s %d" "$i" "'$i"); done
a 97
b 98
c 99
d 100
e 101
f 102
g 103
h 104
i 105
j 106
k 107
l 108
m 109
n 110
o 111
p 112
q 113
r 114
s 115
t 116
u 117
v 118
w 119
x 120
y 121
z 122
for i in {0..9}; do echo $(printf "%s %d" "$i" "'$i"); done
0 48
1 49
2 50
3 51
4 52
5 53
6 54
7 55
8 56
9 57
reverse
LC_CTYPE=C printf '%d' "'A"
65
printf "\U$(printf %08x 128520)\n"
😈
echo -e "\033[0;31mbrown text\033[0;00m"
printf "\x1b[38;2;40;177;249mTRUECOLOR\x1b[0m\n"
echo -e "\033[38;5;208mpeach\033[0;00m"
echo -e "testing \033[0;37;41mCOLOR1\033[1;35;44mCOLOR2\033[m"
ps1 code
\u - the current user's username
\h - the current machine's hostname
\j - the number of jobs managed by this shell
\@ - the current time (12 hour format)
\d - the current date
\w - path of the current working directory
\W - just the current working directory
\e - an ASCII escape character (033)
\n - adds a newline character
PS1='\w \n\u@\h\$'
#!/bin/bash
#
# generates an 8 bit color table (256 colors) for reference,
# using the ANSI CSI+SGR \033[48;5;${val}m for background and
# \033[38;5;${val}m for text (see "ANSI Code" on Wikipedia)
#
echo -en "\n + "
for i in {0..35}; do
printf "%2b " $i
done
printf "\n\n %3b " 0
for i in {0..15}; do
echo -en "\033[48;5;${i}m \033[m "
done
#for i in 16 52 88 124 160 196 232; do
for i in {0..6}; do
let "i = i*36 +16"
printf "\n\n %3b " $i
for j in {0..35}; do
let "val = i+j"
echo -en "\033[48;5;${val}m \033[m "
done
done
echo -e "\n"
#!/bin/bash
#
# This file echoes a bunch of color codes to the terminal to demonstrate
# what's available. Each line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a test use of that color
# on all nine background colors (default + 8 escapes).
#
T='gYw' # The test text
echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m";
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m';
do FG=${FGs// /}
echo -en " $FGs \033[$FG $T "
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m\033[$BG \033[0m";
done
echo;
done
echo
LC_ALL=C.UTF8 ./hsvrgb-browser.sh
https://f-hauri.ch/vrac/hsvrgb.sh.txt
https://f-hauri.ch/vrac/hsvrgb-browser.sh.txt
https://en.wikipedia.org/wiki/ANSI_escape_code#graphics
https://web.archive.org/web/20131009193526/http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux
Comments
Post a Comment