Last active
March 19, 2021 12:20
-
-
Save deven96/19572b9bb20899103f0f901a5ae13865 to your computer and use it in GitHub Desktop.
Excuses with Bash
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 | |
function checkOS { | |
... | |
} | |
function addOneHourLinux { | |
date -d '+1 hour' | |
} | |
function addOneHourMac { | |
date -v+1H | |
} | |
# set $machine variable | |
checkOS | |
# variables are replaced with their values so | |
# addOneHour$machine on Linux => addOneHourLinux | |
# yay for crappy compatibility | |
addOneHour$machine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment