Created
December 4, 2015 13:30
-
-
Save dirkjanfaber/bff07bc5111a6fc2d222 to your computer and use it in GitHub Desktop.
Script for wrapping at in a function. This fixes the garbled time in most cases.
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
function at { | |
unset IFS | |
MOMENT=$* | |
AT=$(which at) | |
# First try at to see if I finally figured out to produce non-garbled time | |
if ${AT} ${MOMENT} 2>/dev/null | |
then | |
# worked allright, we can exit | |
exit | |
else | |
# We produced garbled time (duh), so let's fix this with date | |
MOMENT=$(date --date "${MOMENT}" +'%Y%m%d%H%M') | |
fi | |
# and try again | |
${AT} -t ${MOMENT} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check http://steviethecat.tumblr.com/post/134525621571/non-garbled-time-with-at for a description.