sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

inte_c_header.sh (539B)


      1 #!/usr/bin/env bash
      2 
      3 YELLOW='\033[1;33m'
      4 GREEN='\033[0;32m'
      5 NC='\033[0m'
      6 filename="./build/mapping.txt"
      7 count=0
      8 
      9 name=""
     10 
     11 echo "#ifndef ICONS_IN_TERMINAL
     12 # define ICONS_IN_TERMINAL
     13 "
     14 
     15 while read -r line
     16 do
     17     if [ "${line:0:1}" = "#" ]
     18     then
     19 	name_num=(${line//:/ })
     20 	name=${name_num[0]:1}
     21     else
     22 	str=""
     23 	IFS=';' read -ra array_glyph <<< "$line"
     24 	for glyph in "${array_glyph[@]}"; do
     25 	    info=(${glyph//:/ })
     26 	    echo "# define ${info[0]^^} \"\u${info[1]}\""
     27 	done
     28     fi
     29 
     30 done < "$filename"
     31 
     32 echo "
     33 #endif // ICONS_IN_TERMINAL
     34 "