On 01/17/2016 06:28 PM, Jack J. Woehr wrote: > Peng Yu wrote: >> I can use coreutils' date to generate a date with a date string as >> follows. >> date -d yesterday >> date -d tomorrow >> > Well, you can start with: > > esyscmd(date) > Sun, Jan 17, 2016 6:24:03 PM > > ... and proceed from there
In particular, you could: define(`YESTERDAY', `esyscmd(`date -d yesterday')') although the resulting date output will be scanned for further macros; if you want to guarantee that it will not be re-expanded, then your syscmd usage also needs to output m4 quoting characters: define(`YESTERDAY', `esyscmd(`printf "`"; date -d yesterday; printf "'"')') Note that the above gets tricky thanks to mixing shell and m4 quoting rules; you may want to consider using changequote() to pick something that mixes nicer with shell (the way autoconf picked [] rather than `' for that very reason). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
