I am creating a report and outputing to a filename. I can't get the current date on the filename because of the report writer limitations. How can I get the current date on the file?
you're question is very broad... You state it's a script... What kind of script, perl, bash, python, etc... why not just enter a
echo `date`
somewhere in the script? Or if its something precompiled, you could still echo `date` >> output. what kind of output is this report, xls, db, txt, pdf, could you be a bit more specific, also what kind of script?
The script is written in Unix. The script calls another script to generate thne file in a report writer. I have the report writer generate part of the name because of it's limitations. How do I re-name the file including todays date?
The script is written in Unix
Unix is an Operating System, not a scripting language.
Ask your sysadmin which shell is used on your location for this script.
You may try something like this:
mv reportname newname$(date +%Y-%m-%d_%H_%M).rpt
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.