Skip to main content
lang-none for the output
Source Link
awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' 
awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' 
 32 0x20 48 0x30 0 64 0x40 @ 80 0x50 P 96 0x60 ` 112 0x70 p 33 0x21 ! 49 0x31 1 65 0x41 A 81 0x51 Q 97 0x61 a 113 0x71 q 34 0x22 " 50 0x32 2 66 0x42 B 82 0x52 R 98 0x62 b 114 0x72 r 35 0x23 # 51 0x33 3 67 0x43 C 83 0x53 S 99 0x63 c 115 0x73 s 36 0x24 $ 52 0x34 4 68 0x44 D 84 0x54 T 100 0x64 d 116 0x74 t 37 0x25 % 53 0x35 5 69 0x45 E 85 0x55 U 101 0x65 e 117 0x75 u 38 0x26 & 54 0x36 6 70 0x46 F 86 0x56 V 102 0x66 f 118 0x76 v 39 0x27 ' 55 0x37 7 71 0x47 G 87 0x57 W 103 0x67 g 119 0x77 w 40 0x28 ( 56 0x38 8 72 0x48 H 88 0x58 X 104 0x68 h 120 0x78 x 41 0x29 ) 57 0x39 9 73 0x49 I 89 0x59 Y 105 0x69 i 121 0x79 y 42 0x2a * 58 0x3a : 74 0x4a J 90 0x5a Z 106 0x6a j 122 0x7a z 43 0x2b + 59 0x3b ; 75 0x4b K 91 0x5b [ 107 0x6b k 123 0x7b { 44 0x2c , 60 0x3c < 76 0x4c L 92 0x5c \ 108 0x6c l 124 0x7c | 45 0x2d - 61 0x3d = 77 0x4d M 93 0x5d ] 109 0x6d m 125 0x7d } 46 0x2e . 62 0x3e > 78 0x4e N 94 0x5e ^ 110 0x6e n 126 0x7e ~ 47 0x2f / 63 0x3f ? 79 0x4f O 95 0x5f _ 111 0x6f o 
 32 0x20 48 0x30 0 64 0x40 @ 80 0x50 P 96 0x60 ` 112 0x70 p 33 0x21 ! 49 0x31 1 65 0x41 A 81 0x51 Q 97 0x61 a 113 0x71 q 34 0x22 " 50 0x32 2 66 0x42 B 82 0x52 R 98 0x62 b 114 0x72 r 35 0x23 # 51 0x33 3 67 0x43 C 83 0x53 S 99 0x63 c 115 0x73 s 36 0x24 $ 52 0x34 4 68 0x44 D 84 0x54 T 100 0x64 d 116 0x74 t 37 0x25 % 53 0x35 5 69 0x45 E 85 0x55 U 101 0x65 e 117 0x75 u 38 0x26 & 54 0x36 6 70 0x46 F 86 0x56 V 102 0x66 f 118 0x76 v 39 0x27 ' 55 0x37 7 71 0x47 G 87 0x57 W 103 0x67 g 119 0x77 w 40 0x28 ( 56 0x38 8 72 0x48 H 88 0x58 X 104 0x68 h 120 0x78 x 41 0x29 ) 57 0x39 9 73 0x49 I 89 0x59 Y 105 0x69 i 121 0x79 y 42 0x2a * 58 0x3a : 74 0x4a J 90 0x5a Z 106 0x6a j 122 0x7a z 43 0x2b + 59 0x3b ; 75 0x4b K 91 0x5b [ 107 0x6b k 123 0x7b { 44 0x2c , 60 0x3c < 76 0x4c L 92 0x5c \ 108 0x6c l 124 0x7c | 45 0x2d - 61 0x3d = 77 0x4d M 93 0x5d ] 109 0x6d m 125 0x7d } 46 0x2e . 62 0x3e > 78 0x4e N 94 0x5e ^ 110 0x6e n 126 0x7e ~ 47 0x2f / 63 0x3f ? 79 0x4f O 95 0x5f _ 111 0x6f o 
command -v ascii &> /dev/null || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 
command -v ascii &> /dev/null || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 
awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' 
 32 0x20 48 0x30 0 64 0x40 @ 80 0x50 P 96 0x60 ` 112 0x70 p 33 0x21 ! 49 0x31 1 65 0x41 A 81 0x51 Q 97 0x61 a 113 0x71 q 34 0x22 " 50 0x32 2 66 0x42 B 82 0x52 R 98 0x62 b 114 0x72 r 35 0x23 # 51 0x33 3 67 0x43 C 83 0x53 S 99 0x63 c 115 0x73 s 36 0x24 $ 52 0x34 4 68 0x44 D 84 0x54 T 100 0x64 d 116 0x74 t 37 0x25 % 53 0x35 5 69 0x45 E 85 0x55 U 101 0x65 e 117 0x75 u 38 0x26 & 54 0x36 6 70 0x46 F 86 0x56 V 102 0x66 f 118 0x76 v 39 0x27 ' 55 0x37 7 71 0x47 G 87 0x57 W 103 0x67 g 119 0x77 w 40 0x28 ( 56 0x38 8 72 0x48 H 88 0x58 X 104 0x68 h 120 0x78 x 41 0x29 ) 57 0x39 9 73 0x49 I 89 0x59 Y 105 0x69 i 121 0x79 y 42 0x2a * 58 0x3a : 74 0x4a J 90 0x5a Z 106 0x6a j 122 0x7a z 43 0x2b + 59 0x3b ; 75 0x4b K 91 0x5b [ 107 0x6b k 123 0x7b { 44 0x2c , 60 0x3c < 76 0x4c L 92 0x5c \ 108 0x6c l 124 0x7c | 45 0x2d - 61 0x3d = 77 0x4d M 93 0x5d ] 109 0x6d m 125 0x7d } 46 0x2e . 62 0x3e > 78 0x4e N 94 0x5e ^ 110 0x6e n 126 0x7e ~ 47 0x2f / 63 0x3f ? 79 0x4f O 95 0x5f _ 111 0x6f o 
command -v ascii &> /dev/null || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 
awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' 
 32 0x20 48 0x30 0 64 0x40 @ 80 0x50 P 96 0x60 ` 112 0x70 p 33 0x21 ! 49 0x31 1 65 0x41 A 81 0x51 Q 97 0x61 a 113 0x71 q 34 0x22 " 50 0x32 2 66 0x42 B 82 0x52 R 98 0x62 b 114 0x72 r 35 0x23 # 51 0x33 3 67 0x43 C 83 0x53 S 99 0x63 c 115 0x73 s 36 0x24 $ 52 0x34 4 68 0x44 D 84 0x54 T 100 0x64 d 116 0x74 t 37 0x25 % 53 0x35 5 69 0x45 E 85 0x55 U 101 0x65 e 117 0x75 u 38 0x26 & 54 0x36 6 70 0x46 F 86 0x56 V 102 0x66 f 118 0x76 v 39 0x27 ' 55 0x37 7 71 0x47 G 87 0x57 W 103 0x67 g 119 0x77 w 40 0x28 ( 56 0x38 8 72 0x48 H 88 0x58 X 104 0x68 h 120 0x78 x 41 0x29 ) 57 0x39 9 73 0x49 I 89 0x59 Y 105 0x69 i 121 0x79 y 42 0x2a * 58 0x3a : 74 0x4a J 90 0x5a Z 106 0x6a j 122 0x7a z 43 0x2b + 59 0x3b ; 75 0x4b K 91 0x5b [ 107 0x6b k 123 0x7b { 44 0x2c , 60 0x3c < 76 0x4c L 92 0x5c \ 108 0x6c l 124 0x7c | 45 0x2d - 61 0x3d = 77 0x4d M 93 0x5d ] 109 0x6d m 125 0x7d } 46 0x2e . 62 0x3e > 78 0x4e N 94 0x5e ^ 110 0x6e n 126 0x7e ~ 47 0x2f / 63 0x3f ? 79 0x4f O 95 0x5f _ 111 0x6f o 
command -v ascii &> /dev/null || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 
small cleanup (I also found out that command -v is commonplace)
Source Link
command -v ascii >&> /dev/null 2>&1 || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 

(note the ; before the function's closing })

Special thanks to Stéphane Chazelas for the pr -t6 part, and to lhunath for the command -v part.

command -v ascii >/dev/null 2>&1 || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 

(note the ;)

Special thanks to Stéphane Chazelas for the pr -t6 part, and to lhunath for the command -v part

command -v ascii &> /dev/null || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 

(note the ; before the function's closing })

Special thanks to Stéphane Chazelas for the pr -t6 part.

added OS-independent function for missing ascii command
Source Link

expandingExpanding on jlliagre's solution (and useful if you don't have the ascii command available):

You can also pipe the above to pr -t6 -w78 to get a one page output:

 32 0x20  48 0x30 0  64 0x40 @  80 0x50 P  96 0x60 `  112 0x70 p 33 0x21 !  49 0x31 1  65 0x41 A  81 0x51 Q  97 0x61 a  113 0x71 q 34 0x22 "  50 0x32 2  66 0x42 B  82 0x52 R  98 0x62 b  114 0x72 r 35 0x23 #  51 0x33 3  67 0x43 C  83 0x53 S  99 0x63 c  115 0x73 s 36 0x24 $  52 0x34 4  68 0x44 D  84 0x54 T  100 0x64 d  116 0x74 t 37 0x25 %  53 0x35 5  69 0x45 E  85 0x55 U  101 0x65 e  117 0x75 u 38 0x26 &  54 0x36 6  70 0x46 F  86 0x56 V  102 0x66 f  118 0x76 v 39 0x27 '  55 0x37 7  71 0x47 G  87 0x57 W  103 0x67 g  119 0x77 w 40 0x28 (  56 0x38 8  72 0x48 H  88 0x58 X  104 0x68 h  120 0x78 x 41 0x29 )  57 0x39 9  73 0x49 I  89 0x59 Y  105 0x69 i  121 0x79 y 42 0x2a *  58 0x3a :  74 0x4a J  90 0x5a Z  106 0x6a j  122 0x7a z 43 0x2b +  59 0x3b ;  75 0x4b K  91 0x5b [  107 0x6b k  123 0x7b { 44 0x2c ,  60 0x3c <  76 0x4c L  92 0x5c \  108 0x6c l  124 0x7c | 45 0x2d -  61 0x3d =  77 0x4d M  93 0x5d ]  109 0x6d m  125 0x7d } 46 0x2e .  62 0x3e >  78 0x4e N  94 0x5e ^  110 0x6e n  126 0x7e ~ 47 0x2f /  63 0x3f ?  79 0x4f O  95 0x5f _  111 0x6f o 

In my OS-independent startup script I have:

command -v ascii >/dev/null 2>&1 || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 

(note the ;)

Special thanks to Stéphane Chazelas for the pr -t6 part, and to lhunath for the command -v part

expanding on jlliagre's solution (and useful if you don't have the ascii command available):

You can also pipe the above to pr -t6 to get a one page output:

 32 0x20 48 0x30 0 64 0x40 @ 80 0x50 P 96 0x60 ` 112 0x70 p 33 0x21 ! 49 0x31 1 65 0x41 A 81 0x51 Q 97 0x61 a 113 0x71 q 34 0x22 " 50 0x32 2 66 0x42 B 82 0x52 R 98 0x62 b 114 0x72 r 35 0x23 # 51 0x33 3 67 0x43 C 83 0x53 S 99 0x63 c 115 0x73 s 36 0x24 $ 52 0x34 4 68 0x44 D 84 0x54 T 100 0x64 d 116 0x74 t 37 0x25 % 53 0x35 5 69 0x45 E 85 0x55 U 101 0x65 e 117 0x75 u 38 0x26 & 54 0x36 6 70 0x46 F 86 0x56 V 102 0x66 f 118 0x76 v 39 0x27 ' 55 0x37 7 71 0x47 G 87 0x57 W 103 0x67 g 119 0x77 w 40 0x28 ( 56 0x38 8 72 0x48 H 88 0x58 X 104 0x68 h 120 0x78 x 41 0x29 ) 57 0x39 9 73 0x49 I 89 0x59 Y 105 0x69 i 121 0x79 y 42 0x2a * 58 0x3a : 74 0x4a J 90 0x5a Z 106 0x6a j 122 0x7a z 43 0x2b + 59 0x3b ; 75 0x4b K 91 0x5b [ 107 0x6b k 123 0x7b { 44 0x2c , 60 0x3c < 76 0x4c L 92 0x5c \ 108 0x6c l 124 0x7c | 45 0x2d - 61 0x3d = 77 0x4d M 93 0x5d ] 109 0x6d m 125 0x7d } 46 0x2e . 62 0x3e > 78 0x4e N 94 0x5e ^ 110 0x6e n 126 0x7e ~ 47 0x2f / 63 0x3f ? 79 0x4f O 95 0x5f _ 111 0x6f o 

Expanding on jlliagre's solution (and useful if you don't have the ascii command available):

You can also pipe the above to pr -t6 -w78 to get a one page output:

 32 0x20  48 0x30 0  64 0x40 @  80 0x50 P  96 0x60 `  112 0x70 p 33 0x21 !  49 0x31 1  65 0x41 A  81 0x51 Q  97 0x61 a  113 0x71 q 34 0x22 "  50 0x32 2  66 0x42 B  82 0x52 R  98 0x62 b  114 0x72 r 35 0x23 #  51 0x33 3  67 0x43 C  83 0x53 S  99 0x63 c  115 0x73 s 36 0x24 $  52 0x34 4  68 0x44 D  84 0x54 T  100 0x64 d  116 0x74 t 37 0x25 %  53 0x35 5  69 0x45 E  85 0x55 U  101 0x65 e  117 0x75 u 38 0x26 &  54 0x36 6  70 0x46 F  86 0x56 V  102 0x66 f  118 0x76 v 39 0x27 '  55 0x37 7  71 0x47 G  87 0x57 W  103 0x67 g  119 0x77 w 40 0x28 (  56 0x38 8  72 0x48 H  88 0x58 X  104 0x68 h  120 0x78 x 41 0x29 )  57 0x39 9  73 0x49 I  89 0x59 Y  105 0x69 i  121 0x79 y 42 0x2a *  58 0x3a :  74 0x4a J  90 0x5a Z  106 0x6a j  122 0x7a z 43 0x2b +  59 0x3b ;  75 0x4b K  91 0x5b [  107 0x6b k  123 0x7b { 44 0x2c ,  60 0x3c <  76 0x4c L  92 0x5c \  108 0x6c l  124 0x7c | 45 0x2d -  61 0x3d =  77 0x4d M  93 0x5d ]  109 0x6d m  125 0x7d } 46 0x2e .  62 0x3e >  78 0x4e N  94 0x5e ^  110 0x6e n  126 0x7e ~ 47 0x2f /  63 0x3f ?  79 0x4f O  95 0x5f _  111 0x6f o 

In my OS-independent startup script I have:

command -v ascii >/dev/null 2>&1 || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; } 

(note the ;)

Special thanks to Stéphane Chazelas for the pr -t6 part, and to lhunath for the command -v part

added 1275 characters in body
Source Link
Stéphane Chazelas
  • 586.4k
  • 96
  • 1.1k
  • 1.7k
Loading
Source Link
Loading