- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Time and Date as part of a files name
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 03:26 PM
09-18-2001 03:26 PM
example
FIN_DATA20010918162545.DAT
'yyyymmddhhmmss'=20010918162545
How might I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 03:45 PM
09-18-2001 03:45 PM
Re: Time and Date as part of a files name
date_time=`date +%Y%m%d%H%M%S`
and then add that onto the filename.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 04:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 05:12 PM
09-18-2001 05:12 PM
Re: Time and Date as part of a files name
The date command is not being recognised in the definition. I tried both single and double quote marks. Any further examples?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 05:28 PM
09-18-2001 05:28 PM
Re: Time and Date as part of a files name
'
and
`
notice the difference? you need to use the second one.
on an hp keyboard it is underneath the ~ on the top left key under the ESC key
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 06:16 PM
09-18-2001 06:16 PM
Re: Time and Date as part of a files name
Try this
STAMP="`date '+%d-%m-%y %H:%M'`"
OUTFILE="FIN_DATA${STAMP}.dat"
Be carefull about all '&`.
Besy of luck
Animesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 09:05 PM
09-18-2001 09:05 PM
Re: Time and Date as part of a files name
filename="FIN_DATA"`date +%Y%m%d%H%M%S`.dat
regards,
Suhas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2001 10:57 PM
09-18-2001 10:57 PM
Re: Time and Date as part of a files name
What you need is the backtick, not a normal single quote.
If you are using a ksh you might also use:
STAMP=$(date +%Y%m%d%H%M%S)
Hope this helps
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2001 07:30 AM
09-19-2001 07:30 AM
Re: Time and Date as part of a files name
I think we would have been more specific. You need to use "command substituition quotes" instead of regular single and double quotes.
It is found usually with the character "~".
-Sri