Add new adhoc draft script
[khome.git] / home / bin / jwt_show
1 #! /usr/bin/awk -f
2
3 function print_title(title, _i) {
4 print title
5 for (_i = 1; _i <= length(title); _i++)
6 printf "="
7 printf "\n"
8 }
9
10 function print_decoded_field(field, _i, _decode) {
11 _decode = "base64 -d | json_pp"
12 print $field | _decode
13 close(_decode)
14 }
15
16 BEGIN {
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.07157 seconds and 4 git commands to generate.