Advertisement
mosaid

read-skills.sh

Feb 29th, 2020
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/bin/bash
  2. pat="$1"
  3. awk -F: -v pat="$pat" '
  4.     {
  5.         if ( $1 ~ /1st Tier/ || $1 ~ /2nd Tier/  \
  6.             || $1 ~ /3rd Tier/ || $1 ~ /[0-9]*th Tier/ \
  7.             || $1 ~ /Overlord Skills/ || $1 ~ /Super-Tier/ \
  8.             || $1 ~ /Special Skill/  && $2 == "" ) {
  9.             tier=$1
  10.         }
  11.         skillname=$1
  12.         skill=$2
  13.         if ( index($1, pat) ){
  14.             printf("\033[1;33m%s\033[1;0m\n",tier);
  15.             printf("\033[1;31m%s\033[1;0m\n",skillname);
  16.             system("echo \"'\"'$2'\"'\" | fmt -w 85 ")
  17.         }
  18.     }
  19.  
  20. ' < "${HOME}/Overlord Skills"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement