Hello.
I have a string variable named L_TEMP to test a very simple filter.
L_TEMP="50AwL.|KWp9jk"
I want to insert a non printable character [ 0x00 - 0x1F ] between K and W.
I have try this :
MY_VAR=$L_TEMP
while read -N 1 ; do
A_CHAR="$REPLY"
if [[ $A_CHAR is not A_PRINTABLE_CHARACTER ]] ; then
MY_VAR=""
break
fi
done <<<"$L_TEMP"
if [[ ! z $MY_VAR ]] ; then
OK KEEP MY_VAR
else
CALCULATE ANOTHER MY_VAR
fi
MY_VAR should set to null if it contains one or more not printable character
Somethings like
grep -E "[all characters are printable]"
my current filter is
grep -E "[one or more characters are printable]"
---------- Post updated at 13:09 ---------- Previous update was at 12:54 ----------