- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: date manipulation in shell script
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
Discussions
Discussions
Forums
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
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
тАО05-07-2004 03:57 AM
тАО05-07-2004 03:57 AM
I, i need to write a shell script where is possible assign to a variable the 'date' value of +n or -n days starting from current date
In other words:
I have:
SYS_DATE="$( date '+%Y%m%d' )"
how can I do something like:
YESTERDAY_DATE= "$( date '+%Y%m%d' )" -1
or
TOMORROW_DATE= "$( date '+%Y%m%d' )" +1
avoid writing date calculation routines?
any ideas?
Tahnkyou
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2004 03:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2004 04:04 AM
тАО05-07-2004 04:04 AM
Re: date manipulation in shell script
http://www.cmve.net/~merijn/#Contrib
It is at the bottom of the page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2004 04:05 AM
тАО05-07-2004 04:05 AM
Re: date manipulation in shell script
YESTERDAY_DATE=$(caljd.sh -s -y $(caljd.sh -p 1))
echo "Yesterday = ${YESTERDAY_DATE}"
TOMORROW_DATE=$(caljd.sh -s -y $(caljd.sh -n 1))
echo "Tomorrow = ${TOMORROW_DATE}"
Invoke as caljd.sh -u for full usage and many examples (like previous date plus skip over weekends).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2004 07:46 PM
тАО05-09-2004 07:46 PM
Re: date manipulation in shell script
http://members.rogers.com/weirdways/technogeek/source/mktime/
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2004 07:54 PM
тАО05-09-2004 07:54 PM
Re: date manipulation in shell script
Thankyou
Regards
Paolo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2004 09:07 PM
тАО05-09-2004 09:07 PM
Re: date manipulation in shell script
Thakyou!