- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: date command problem
Operating System - HP-UX
1756552
Members
2472
Online
108848
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО02-02-2009 09:22 PM
тАО02-02-2009 09:22 PM
How to get the date of yesterday under date command?
I checked the manual, it seems not possible.
could someone provide the shell code for me to solve this question?
Best
I checked the manual, it seems not possible.
could someone provide the shell code for me to solve this question?
Best
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 09:50 PM
тАО02-02-2009 09:50 PM
Solution
Try the following command at your unix prompt:
perl -e 'print localtime(time() - 86400) . "\n" '
If your unix machine has Perl installed, then it will work.
Check below link Use the date_calc script to calculate the date you need then pass it as a parameter to your script
http://www.unix.com/unix-dummies-questions-answers/4870-days-elapsed-between-2-dates.html#post16559
Thx,
Johnson
perl -e 'print localtime(time() - 86400) . "\n" '
If your unix machine has Perl installed, then it will work.
Check below link Use the date_calc script to calculate the date you need then pass it as a parameter to your script
http://www.unix.com/unix-dummies-questions-answers/4870-days-elapsed-between-2-dates.html#post16559
Thx,
Johnson
Problems are common to all, but attitude makes the difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 10:03 PM
тАО02-02-2009 10:03 PM
Re: date command problem
>I checked the manual, it seems not possible.
Right. You would have to do time cracking and reformatting in the shell.
You can also use Clay's caljd script:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1158441
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=541033
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=563529
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=113540
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=844856
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1157124
Johnson: They are looking for your reply to your congrats thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1291891
Right. You would have to do time cracking and reformatting in the shell.
You can also use Clay's caljd script:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1158441
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=541033
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=563529
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=113540
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=844856
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1157124
Johnson: They are looking for your reply to your congrats thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1291891
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2009 11:47 AM
тАО02-03-2009 11:47 AM
Re: date command problem
Depending on your environment and your needs it might be easier to grab GNU date (part of coreutils), which lets you do nifty things like "date -d yesterday". Just make sure GNU date isn't in your system-wide PATH or give it a different name so that you don't have any problems with tools that expect HP's date.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP