Add num_circle script to transform a number into a digit with a circle.

This commit is contained in:
Jeremy Gardais 2015-11-20 09:27:47 +01:00
parent 430473a8ad
commit 23fc091fc5
2 changed files with 18 additions and 0 deletions

View File

@ -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).

11
num_circle Executable file
View File

@ -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