Skip to content

Instantly share code, notes, and snippets.

@deven96
Last active March 19, 2021 12:20
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 deven96/19572b9bb20899103f0f901a5ae13865 to your computer and use it in GitHub Desktop.
Save deven96/19572b9bb20899103f0f901a5ae13865 to your computer and use it in GitHub Desktop.
Excuses with Bash
#!/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