Skip to content

Instantly share code, notes, and snippets.

@alunux
Last active December 12, 2017 20:11
Show Gist options
  • Save alunux/c86bd2cd172eec89c9bf007f240eb93e to your computer and use it in GitHub Desktop.
Save alunux/c86bd2cd172eec89c9bf007f240eb93e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Coba: ./cek-hari-kerja 07 Agustus 2017
declare -A bulanku=(
["januari"]="1"
["februari"]="2"
["maret"]="3"
["april"]="4"
["mei"]="5"
["juni"]="6"
["juli"]="7"
["agustus"]="8"
["september"]="9"
["oktober"]="10"
["november"]="11"
["desember"]="12"
)
cekhari=$(date --date "$3-${bulanku[${2,,}]}-$1" +%u)
if [[ cekhari -gt 5 ]]; then
echo "HARI LIBUR"
else
echo "HARI KERJA"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment