From fa1cf57ab5febfaeb9f281bebb96ef3644826f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega=20Froysa?= Date: Sat, 12 Mar 2022 12:23:32 +0100 Subject: [PATCH] Initial commit. --- README.md | 20 ++++++++++++++++++++ countdown.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 README.md create mode 100755 countdown.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..60b3214 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# CountDown.sh +A simple script to countdown from a certain number to zero. I made it so that +I can easily delay the playing time of songs by a few seconds before I play it +on the guitar. + +``` +USAGE: + countdown.sh + +OPTIONS: + number to countdown from [default: 5] + +EXAMPLE: + Countdown from 7 and then play Scott Stapp's "Last Hallelujah" + ./countdown 7 ; mpv 12_-_Last_Hallelujah.flac +``` + +## License + +This project is licensed under the terms & conditions of the ZLib license. diff --git a/countdown.sh b/countdown.sh new file mode 100755 index 0000000..717ebe1 --- /dev/null +++ b/countdown.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright (C) 2022 Ortega Froysa, Nicolás All rights reserved. +# Author: Ortega Froysa, Nicolás +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source +# distribution. + +if [ -z $1 ] +then + COUNT=5 +else + COUNT=$1 +fi + +for i in $(seq $COUNT -1 1) +do + echo $i + sleep 1 +done + +echo 0