Skip to content

Instantly share code, notes, and snippets.

@tastytea
Last active May 10, 2018 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tastytea/0b3c6d28400638fa1dea637e4f52a8f1 to your computer and use it in GitHub Desktop.
Save tastytea/0b3c6d28400638fa1dea637e4f52a8f1 to your computer and use it in GitHub Desktop.
Prüft, ob heute oder morgen ein feiertag ist.
#!/bin/sh
today="$(date +'%d.%m.%Y')"
tomorrow="$(date -d tomorrow +'%d.%m.%Y')"
for holiday in $(feiertage -region Niedersachsen $(date +'%Y') | awk '{print $1}'); do
if [[ "${holiday}" != "Niedersachsen" ]]; then
if [[ "${holiday}" == "${today}" ]]; then
echo "Heute ($(date +'%A')) ist ein feiertag."
fi
if [[ "${holiday}" == "${tomorrow}" ]]; then
echo "Morgen ($(date -d tomorrow +'%A')) ist ein feiertag."
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment