aboutsummaryrefslogtreecommitdiff
path: root/years.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-05-23 11:30:25 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2019-05-23 11:30:25 +0200
commit7cde0dc02c0a8349ab7769f934a29cf1578995b5 (patch)
tree4cefe1f81b76abce02aaac62b0ebc08a3f7870e6 /years.sh
parentc3856a49d47c164991550f10ace030eb6a646ce6 (diff)
downloadscripts-7cde0dc02c0a8349ab7769f934a29cf1578995b5.tar.gz
scripts-7cde0dc02c0a8349ab7769f934a29cf1578995b5.zip
Changed calendars to bash and standardize code.
Diffstat (limited to 'years.sh')
-rwxr-xr-xyears.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/years.sh b/years.sh
index a3f2f5e..65fbe5e 100755
--- a/years.sh
+++ b/years.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# _ _ ___ __ _ _ __ ___
# | | | |/ _ \/ _` | '__/ __|
# | |_| | __/ (_| | | \__ \
@@ -9,20 +9,20 @@
year=$(date +%Y)
cal -m -y
-read -n 1 input
+read -rn 1 input
while [ "$input" != "q" ]
do
- case $input in
+ case "$input" in
l)
- year=$(($year+1))
+ year=$((year+1))
;;
h)
- year=$(($year-1))
+ year=$((year-1))
;;
esac
- clear
- cal -m -y $year
- read -n 1 input
+ clear
+ cal -m -y "$year"
+ read -rn 1 input
done