Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save showgo001/35bd92978d29026fbdac70fa43bc261e to your computer and use it in GitHub Desktop.
Save showgo001/35bd92978d29026fbdac70fa43bc261e to your computer and use it in GitHub Desktop.
convert circle-number symbol into number and underscore
function convert {
arr=$1
for (( i = 0; i < ${#arr[@]}; ++i ))
do
if[ i > 9 ] then pad = i
else pad = 0${i}
fi
zmv -nW '*${arr[$i]}*' '*${pad}_*'
done
}
arr=("⓪" "①" "②" "③" "④" "⑤" "⑥" "⑦" "⑧" "⑨" "⑩" "⑪" "⑫" "⑬" "⑭" "⑮" "⑯" "⑰" "⑱" "⑲" "⑳" "㉑" "㉒" "㉓" "㉔" "㉕" "㉖" "㉗" "㉘" "㉙" "㉚" "㉛" "㉜" "㉝" "㉞" "㉟" "㊱" "㊲" "㊳" "㊴" "㊵" "㊶" "㊷" "㊸" "㊹" "㊺" "㊻" "㊼" "㊽" "㊾" "㊿")
convert arr
arr=("⓿"
"❶" "❷" "❸" "❹" "❺" "❻" "❼" "❽" "❾" "❿"
"⓫" "⓬" "⓭" "⓮" "⓯" "⓰" "⓱" "⓲" "⓳" "⓴" )
convert arr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment