#!/bin/bash

printf -v ASCII_SET '\%o' {32..126}
printf -v ASCII_SET "$ASCII_SET"
echo ASCII_SET-size=${#ASCII_SET}      # shoud be 95

echo "echo1 ${ASCII_SET:85:1}"         # should be letter u at the end
echo "echo2 ${ASCII_SET:$((95-10)):1}" # should be letter u at the end
echo "echo3 ${ASCII_SET:95-10:1}"      # should be letter u at the end

printf -v a_int '%d' "'a" # very strage sintax here to use char as integer
echo "echo4 $a_int"       # should be 97 at the end

echo "echo5 ${ASCII_SET:$((a_int-12)):1}" # you can see letter u at the end as at 97-12=85 place
echo "echo6 $((a_int-12))" # you can see 85 at the end

unset a                # just for further experiments
echo "echo7 $((a-10))" # you can see -10 at the end
echo "echo8 -10"       # you can see -10 at the end

echo See some strange results below
echo "echo9 ${ASCII_SET:$((a-10)):1}" # somehow you can see letter u at the end as at ASCII_size-10 :(
echo "echo10 ${ASCII_SET:$((-10)):1}" # somehow you can see letter u at the end as at ASCII_size-10 :(
echo And the most strange result
echo "echo11 ${ASCII_SET:-10:1}"      # somehow you will see all ASCII_SET symbols after echo11 :(
