I'm trying to filter out all the displayable characters in a list.
Awk gives an incorrect result.
thanks for help.
Code:
ch="" #show
ch="֎" #omit
[[ $(fc-list :charset=$(printf %x "'$ch")) ]] && echo $ch
Awk gives an incorrect result.
Code:
printf "%x" \""֎" # correct result 58e
echo -e "֎" | awk '{ system("printf \"%x\" \\\""$0"") }' # false result d6(base) '
# complete script
cat "list" | awk '{split($0, z, ""); for(y=0; y<length(z); y++){ if(system("/usr/bin/fc-list :charset=$(/usr/bin/printf \"%x\" \\\"\""z[y]"\")")){ print z[y] } } }'
thanks for help.