Display an ASCII table of characters 32 to 112 wit

2019-09-28 03:13发布

问题:

Please, I want to know how to display an ASCII table of characters 32 to 112.

回答1:

You can use following command

man ascii

It shows ascii table.

For displaying ascii from 32 to 112

for((i=32;i<=112;i++)) do printf "$i --> ";printf \\$(printf '%03o\t' "$i");printf '\n' ;done;printf "\n"


回答2:

You can do it quite succinctly with Perl like this:

perl -E 'say $_," --> ",chr($_) for (32..112)' 

Sample Output

32 -->  
33 --> !
34 --> "
35 --> #
36 --> $
37 --> %
38 --> &
39 --> '
40 --> (
41 --> )
...
...


标签: bash shell