Skip to content

Instantly share code, notes, and snippets.

@michieldewilde
Last active August 29, 2015 14:11
Show Gist options
  • Save michieldewilde/9072e027358fb8008b54 to your computer and use it in GitHub Desktop.
Save michieldewilde/9072e027358fb8008b54 to your computer and use it in GitHub Desktop.
script that cals the cal CLI command but for dutch speakers
#! /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