From 7cde0dc02c0a8349ab7769f934a29cf1578995b5 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Thu, 23 May 2019 11:30:25 +0200 Subject: Changed calendars to bash and standardize code. --- years.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'years.sh') 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 -- cgit v1.2.1