<div dir="ltr">I have a piece that adds a formatted date to a file name in this tar command<br><pre>tar czf <span class="">"${directory1}""$h"</span>_backups_<span class="">`</span>date <span class="">'+%F_%H_%M'</span><span class="">`</span>.tar.gz <span class="">"${directory2}"</span>*.tar.gz</pre>
h=`hostname`<br><br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">Wolf Halton<br><br>--<br>This Apt Has Super Cow Powers - <a href="http://sourcefreedom.com" target="_blank">http://sourcefreedom.com</a><br>
Security in the Cloud - <a href="http://atlantaCloudTech.com" target="_blank">http://AtlantaCloudTech.com</a><br>Apache Developer <a href="mailto:wolfhalton@apache.org" target="_blank">wolfhalton@apache.org</a><br></div></div>
<br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 5:53 PM, Derek Carter (aka goozbach) <span dir="ltr"><<a href="mailto:goozbach@friocorte.com" target="_blank">goozbach@friocorte.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div><div class="h5"><br>
On 2013-11-12, 1334, Scott Plante wrote:<br>
> Does anyone happen to know of a command line tool that will read<br>
> lines from standard input and write them to std out, pre-pending a<br>
> timestamp? I have a process that emits messages to std out<br>
> periodically as it processes and I'd like to write that to a log<br>
> file, but with a time at the start of the line. I could do it with<br>
> a script but a nice little command would be better, if it exists.<br>
><br>
> I'm looking for something that would perform the function of this<br>
> script, maybe with an option for format:<br>
><br>
> while read line; do echo $(date +"%D %T") "$line"; done<br>
><br>
> Scott<br>
<br>
</div></div>I wrote a bash library to do logging in my scripts which might be<br>
worth a look:<br>
<br>
<a href="https://github.com/goozbach/log4bats" target="_blank">https://github.com/goozbach/log4bats</a><br>
<br>
- --<br>
Derek<br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)<br>
Comment: GPGTools - <a href="http://gpgtools.org" target="_blank">http://gpgtools.org</a><br>
Comment: Using GnuPG with Thunderbird - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
<br>
iQIcBAEBAgAGBQJSgrGEAAoJECcWlbcE84qz45oP/09sYJOUhA0KElNZWVFmLmNh<br>
ovGGINxIIlEiNOnKifpYqpPpZP2pM6Mj43ctaX9ADvB42Jm4eDLdp9pZDPw2VqmS<br>
+WDBrB9zOuPbCM7A41bvGTP7bMvgLvWt8p0xex9as5QZd7XbAwxYG48qOs6hNHvw<br>
LhdtOfQeQBEd2/dYxouGQ7+F1Pi5CKSGuNHu6bIuBBwlYjqN+G/qClgt7UiFtR/y<br>
WnU7rQsGRiZKXWRtAGBkfBl1UdbjfU8yejBaz72uA+rJ1GZ8agG4lpSzd9gzpbE1<br>
wD6h0NaueAyFHFlwbClfiFZsemkJKCbdvpGmvaE6TjJVAJ8lnw2qpCJ9mEkm3BYi<br>
mE72dT+okJwdZ7mdE6nnhQn1CR8wyPGpAkA5+eXDSti8YbKrO2RN/RnVAS1bjS6L<br>
/EcKMGwLzEm2DY1ttWtIZJ5O7daqXwXakyupgmk6XUUpTgidRUD4QrOO2blCaHmv<br>
s4DfON4QDVZQS8O5cGckNx5pBu5zWOwSHF813BSsxpQEgs0DsMC4QYneiRLy/o7w<br>
yn4QaRjFj33dQgdaCWHDkLeLADvEuXE2vAY4xVbFoqrSe6DOuCPVpm9SnjVxtTXn<br>
PWRA03FRJlhyAMZWnXtfnJBsLfdSU3DsWvvjiZ9PbzdGhzhNIL1tsqhIIKNDT+iU<br>
+X01AgWTQGjBbZkwktgG<br>
=4Zd+<br>
-----END PGP SIGNATURE-----<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br></div>