- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Date calculation in shell
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
01-29-2004 10:03 PM
01-29-2004 10:03 PM
could you please suggest a method in shell to add or subtract a certain number of days to a date, i.e. the date returned by the "date" command?
My environment is Hp-ux 11.0.
Thank you in advance!
Best regards.
Diego.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 10:14 PM
01-29-2004 10:14 PM
SolutionI would suggest you go to Merijn's site and download a version of A. Clay Stephenson's excellent clajd.sh script. Merijn's site can be found here:
http://www.cmve.net/~merijn/#Statistics
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 10:22 PM
01-29-2004 10:22 PM
Re: Date calculation in shell
One method is using the following format:
# date +%Y
2004
Second method is using set command:
$ date
Fri Jan 30 06:21:34 EST 2004
$ set `date`
$ echo $1
Fri
$ echo $2
Jan
$ echo $3
30
$ echo $4
06:21:39
$ echo $5
EST
$ echo $6
2004
Hope this helps
Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 10:30 PM
01-29-2004 10:30 PM
Re: Date calculation in shell
Here's another of Merijn's mirror sites, just in case cmve.net is unavailable:
http://www.hpux.ws/merijn/
It's all the way at the bottom of the page, described as "* A. Clay Stephenson's Date Hammer Shell version or Perl version"
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 10:33 PM
01-29-2004 10:33 PM
Re: Date calculation in shell
"calj.sh" could be found on the favourite script thread "favourite sysadmin scripts you always keep around...."
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x026250011d20d6118ff40090279cd0f9%2C00.html&admit=716493758+1075462236234+28353475
Rgds,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2004 12:16 AM
01-30-2004 12:16 AM
Re: Date calculation in shell
thank you to everyone, your suggestions helped.
Bye!
Diego.