diff --git a/README.md b/README.md index aee5834..947d9a9 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Some useful scripts (for me) that can be added to $PATH :) * firewall: A script shell to set some iptables rules. * update-dynmotd.d/: scripts to update the motd (via the /etc/update-motd.d directory). * flac_to_mp3: convert all flac files of a directory into mp3. +* num_circle: Transform a number into a digit with a circle. * pomodoro: Print a task and a timer in a file. Try to apply Pomodoro Technique! * snapsend.sh: Send a ZFS snapshot to a remote host. * test_ssl3: Test if a website supportes the SSLV3 protocol. @@ -17,6 +18,12 @@ Some useful scripts (for me) that can be added to $PATH :) * zenity_generator: Script to generate zenity window. * zfSnap.sh: Take snapshot of a ZFS pool. +### Num_circle +Tiny Bash script that take a number between 0 and 20 as argument and transform it into a digit with into a circle. +```sh +num_circle 18 +⑱ +``` ### Pomodoro My implementation of the Pomodoro Technique (https://en.wikipedia.org/wiki/Pomodoro_Technique). diff --git a/num_circle b/num_circle new file mode 100755 index 0000000..4eb3707 --- /dev/null +++ b/num_circle @@ -0,0 +1,11 @@ +#!/bin/bash +circled_digit() { + circled_digits='⓪①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳' + if [ $1 -lt 20 ] 2>/dev/null ; then + printf '%b' "${circled_digits:$1:1}\n" + else + printf '%b' "Must give a number between 0 and 20. Not '$1'\n" + fi +} + +circled_digit $1