I frequently use awk time functions and am switching some scripts over to mawk. I don't have the mktime or strftime functions in mawk, but it appears that there is a way, as explained here in "Time functions":
So, simple question... How do I make support for C mktime and strftime functions available? Apologies if I've overlooked something simple, and many thanks in advance.
Thanks for the reply. I'm running CentOS 6.0 x86_64. I'm very sorry to say I don't know how to determine whether it has mktime and strftime. How would I do that?
Also, while the unix.com man page library does have a mawk entry, it appears to differ from the one I linked, lacking at least the time-related entries I cited. Is it still ok to link externally in that case?
I think what I have is the newest version of mawk available for my system:
# mawk -W version
mawk 1.3.4 20120627
How might I get it to recognize the functions I need? Or, for that matter, how would I verify their availability on my system? Regular awk can use those functions. Does it call the same C functions that mawk apparently does? Thanks again for the responses.
that's what I'd thought as well, but the man page posted at the site where I got mawk indicated otherwise. I'd link it, but apparently that gets smooshed if I try.
I recently learned otherwise. Recent versions of mawk have borrowed this useful feature, possibly because some Linux distributions have taken to mawk as a faster substitute for GNU awk.