projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c9436a4
)
added timestamper function
author
Fred T. Hamster
<fred@gruntose.com>
Fri, 26 Jan 2024 14:26:24 +0000
(09:26 -0500)
committer
Fred T. Hamster
<fred@gruntose.com>
Fri, 26 Jan 2024 14:26:24 +0000
(09:26 -0500)
scripts/core/functions.sh
patch
|
blob
|
history
diff --git
a/scripts/core/functions.sh
b/scripts/core/functions.sh
index b39a9d3005986dc4357d956704515de201542e3a..6cf06befe3dab0933527c0aee82bb9c59caca2d1 100644
(file)
--- a/
scripts/core/functions.sh
+++ b/
scripts/core/functions.sh
@@
-32,6
+32,13
@@
if [ -z "$skip_all" ]; then
if [ -z "$sep" ]; then sep='_'; fi
date +"%Y$sep%m$sep%d$sep%H%M$sep%S" | tr -d '/\n/'
}
if [ -z "$sep" ]; then sep='_'; fi
date +"%Y$sep%m$sep%d$sep%H%M$sep%S" | tr -d '/\n/'
}
+
+ # a slightly different but also handy time and date function. this is
+ # intended for prefixing on log lines, so that each line has the time it
+ # occurred as the first element.
+ function timestamper() {
+ date +"[%Y-%m-%d %H:%M:%S] " | tr -d '/\n/'
+ }
# a wrapper for the which command that finds items on the path. some OSes
# do not provide which, so we want to not be spewing errors when that
# a wrapper for the which command that finds items on the path. some OSes
# do not provide which, so we want to not be spewing errors when that