[download]

local/bin/days

   1 #!/bin/bash
   2 
   3 n=$(date +%_d)
   4 f=~/Заметки/Дни.wiki
   5 
   6 [[ -f $f ]] || exit
   7 
   8 while IFS=$'\t' read a b _; do
   9     [[ $a == $n* ]] && list+=("$a  -  $b 🎂") bday+="${a% *}|"
  10     [[ $a == $n* ]] || list+=("$a  -  $b"   ) days+="${a% *}|"
  11 done < <(
  12     grep $(date +%B) $f  |
  13     sed 's/\s*|\s*/\t/g' | sort
  14 )
  15 
  16 cal | sed -E "
  17     s/(^|\s+)(${bday}Q)(\s+|$)/\1*\3/g
  18     s/(^|\s+)(${days}Q)(\s+|$)/\1 \3/g
  19     s/(^|\s+)($(date +%d))(\s+|$)/\1 *\3/g
  20 "
  21 
  22 printf '%s\n' "${list[@]}" && [[ $bday ]]