Feat: Date/time module

This commit is contained in:
Narvin Singh 2020-12-27 22:13:52 -05:00
parent da7febb8f9
commit 1e331865af

17
module/dt Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
run () {
# Customizable configuration constants
local -r DEFAULT_FMT='%a %d %I:%M%p'
local -r DEFAULT_PRE=''
local -r DEFAULT_SUF=''
local -r fmt="${1:-${DEFAULT_FMT}}"
local -r pre="${2-${DEFAULT_PRE}}"
local -r suf="${3-${DEFAULT_SUF}}"
printf '%b%b%b' "${pre}" "$(date +"${fmt}")" "${suf}"
}
run "$@"