Skip to content

Initiate prime title

Compare
Choose a tag to compare
@eq19 eq19 released this 06 Dec 05:37
· 127 commits to v2 since this release
d3a1677
#!/usr/bin/env bash

FILE=${1##*/}
SORT=${FILE%.*}
NUM=$(($SORT + 0))

sed -i 's/πŸ’Ž:/sort:/g' $1
sed -i 's/πŸš€:/spin:/g' $1
sed -i 's/πŸ”¨:/span:/g' $1
sed -i 's/πŸ“‚:/suit:/g' $1

while IFS=' ' read -ra SPIN; do
  S+=("${SPIN[0]}")
  P+=("${SPIN[1]}")
  I+=("${SPIN[2]}")
  N+=("${SPIN[3]}")
done < exponentiation/span18/gist.txt

IFS=$'\n' read -d '' -r -a LINE < _Sidebar.md
TEXT=${LINE[$SORT]} && TITLE=${TEXT%|*}

FRONT="---\n"
FRONT+="sort: $SORT\n"
FRONT+="suit: ${S[$SORT]}\n"
FRONT+="---\n"
FRONT+="# $TITLE\n\n"

[[ $SORT =~ ^-?[0-9]+$ && $NUM -le 9 ]] && sed -i "1s|^|$FRONT|" $1

if [[ "$SORT" == "0" || "$SORT" == "1" || "$SORT" == "9" ]]; then
  mv -f $1 ${1%/*}/README.md
  sed '1,6!d' ${1%/*}/README.md
fi

Screenshot_2023-12-06-12-34-10-020_com android chrome