Last active
August 29, 2015 14:11
-
-
Save michieldewilde/9072e027358fb8008b54 to your computer and use it in GitHub Desktop.
script that cals the cal CLI command but for dutch speakers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ "$#" == "0" ]; then | |
echo You have to give at least one parameter. | |
exit 1 | |
fi | |
givenMonth=$1 | |
Months=(jan feb maa apr mei jun jul aug sep okt nov dec) | |
for i in `seq 0 ${#Months[@]}` | |
do | |
if [[ $givenMonth == ${Months[$i]} ]]; then | |
let i++; | |
if [[ $# < 2 ]] | |
then | |
$2=$(date "+%Y") | |
fi | |
cal $i $2 | |
fi | |
done | |
if [[ $# < 2 ]]; then | |
echo You have given a faulty parameter | |
exit 1; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment