Last active
December 12, 2017 20:11
-
-
Save alunux/c86bd2cd172eec89c9bf007f240eb93e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# 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