Simplify conversion to human-readable units
[khome.git] / home / bin / jwt_show
CommitLineData
16fa69ff
SK
1#! /usr/bin/awk -f
2
3function print_title(title, _i) {
4 print title
5 for (_i = 1; _i <= length(title); _i++)
6 printf "="
7 printf "\n"
8}
9
10function print_decoded_field(field, _i, _decode) {
11 _decode = "base64 -d | json_pp"
12 print $field | _decode
13 close(_decode)
14}
15
16BEGIN {
17 FS = "."
18}
19
20{
21 print_title("Header")
22 print_decoded_field(1)
23 print_title("Payload")
24 print_decoded_field(2)
25 print_title("Signature")
26 print $3
27}
This page took 0.11902 seconds and 4 git commands to generate.