Unix – Fetching ASCII Code of any Character and Character Value from the ASCII Code

By -

This is the demo of fetching ASCII code of any character value and vice versa (Character value from the ASCII Code).

The below is the demo for the “A” and “65”.

Ascii value of character:
It can be done in 2 ways:

  1. printf “%d” “‘A”
  2. echo “A” | tr -d “n” | od -An -t dC


Character value from Ascii:

awk -v char=65 ‘BEGIN { printf “%cn”, char; exit }’

CEO & Co-Founder at SolGuruz® | Organiser @ GDG Ahmedabad | Top 0.1% over StackOverflow | 15+ years experienced Tech Consultant | Helping startups with Custom Software Development

Loading Facebook Comments ...
Loading Disqus Comments ...