98 lines
2.2 KiB
Plaintext
98 lines
2.2 KiB
Plaintext
|
TP03
|
||
|
|
||
|
I-
|
||
|
|
||
|
0 --> 1 octet ASCII
|
||
|
110.. --> 3 octets
|
||
|
1110.. --> 3 octets et après 10... à l'octet suivant
|
||
|
11110.. --> 4 octets
|
||
|
|
||
|
c2 = (110)0 0010, a5= (10)10 0101 == u+a5 symbole yen
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
e2 = (111)0 0010, 99 = (10)01 1000, a0 = (10)10 0000 == u+2660
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
e2 = (111)0 0010, 84 = (10)00 0100, 97 = (10)01 0111 == u+2117
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
24 = (0)010 0100 == u+24 $
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
c2 = (110)0 0010, a3= (10)10 0011 == u+a3 pound sign
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
e2 = (111)0 0010, 82 = (10)00 0010, ac = (10)10 1100 == u+20ac
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
e2 = (111)0 0010, 98 = (10)01 1000, bb = (10)11 1011 == u+263b
|
||
|
2c = (0)010 1100 == u+2c ","
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
61 = (0)110 0001 == u+61
|
||
|
72 = (0)111 0010 == u+71
|
||
|
20 = (0)010 0000 == u+20 ""
|
||
|
6e = (0)110 1110 == u+6e
|
||
|
6f = u+6f
|
||
|
74 = u+74
|
||
|
20 = " "
|
||
|
61 = u+61
|
||
|
6c = u
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
0a = u+0a
|
||
|
|
||
|
II-
|
||
|
|
||
|
1) ma bash
|
||
|
--> paragraphe "SHELL BUILTIN COMMANDS"
|
||
|
|
||
|
2)
|
||
|
-->$x: VALEUR DE LA VARIABLE x
|
||
|
|
||
|
3) read x
|
||
|
--> echo $x
|
||
|
|
||
|
4) read -p "Prompt:"x
|
||
|
Prompt: ______
|
||
|
echo$x on demande à l'utilisateur le x la valeur de x
|
||
|
|
||
|
5) l'option -n
|
||
|
echo -n "blabla"
|
||
|
|
||
|
6) Séquence, il fait les choses dans l'ordre quand tu demandes au cmd de faire exemple cd; rm quelque chose
|
||
|
|
||
|
7) echo -n "Type var value "
|
||
|
|
||
|
III -
|
||
|
|
||
|
1) echo -e "\U45" -e
|
||
|
|
||
|
2) echo -n "Type en HEX UNICODE"; read x; echo -e "Corresponding CHAR \U$x"
|
||
|
|
||
|
==> Type on HEX UNICODE: ___
|
||
|
Corresponding CHAR : le symbole
|
||
|
|
||
|
3) print-unicode-char
|
||
|
chmod u+r print-unicode-char
|
||
|
./print-unicode-char
|
||
|
c'est pour ajouter le code à l'intérieur et il rajoute des perm pour l'executé avec X
|
||
|
___________
|
||
|
printen PATH
|
||
|
which ls
|
||
|
|
||
|
IV -
|
||
|
|
||
|
1) echo -en "\U2660" | hexdumb -C
|
||
|
permet d'afficher le code utf-8 (hexé) du unicode donné
|
||
|
2) en créant un ficher nommé print-hex avec la commande "echo -en "\U$1"de prendre l'argument cad après avoir mit le ficher la commande ou ce que t'a écrit après le fichier il va prendre en compte
|
||
|
chmod u+x print-hex
|
||
|
./print-hex ...
|
||
|
00000000000 .... .... .... ("caractère")
|
||
|
0000000000.
|