From 23fc091fc5be7f6bc14444edaad1433a7c47b787 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 20 Nov 2015 09:27:47 +0100 Subject: [PATCH] Add num_circle script to transform a number into a digit with a circle. --- README.md | 7 +++++++ num_circle | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100755 num_circle 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