- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- date "n" date ago change with variable
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
тАО02-26-2009 09:17 PM
тАО02-26-2009 09:17 PM
date "n" date ago change with variable
I want to write a script to get a date 5 days ago from current date or after from current date.
perl -MPOSIX -le 'print strftime "%Y-%m-%d",localtime(time-(5*60*60*24))'
i know with the scirpt it's work
but my problem is change the 5 value with a variablem??
$ perl -MPOSIX -le 'print strftime "%Y-%m-%d",localtime(time-(5*60*60*24))'
2009-02-22
$ n=5
$ echo $n
5
$ perl -MPOSIX -le 'print strftime "%Y-%m-%d",localtime(time-($n*60*60*24))'
2009-02-27
help me
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 11:01 PM
тАО02-26-2009 11:01 PM
Re: date "n" date ago change with variable
perl -MPOSIX -le 'print strftime "%Y-%m-%d",localtime(time-('$n'*60*60*24))'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 11:32 PM
тАО02-26-2009 11:32 PM
Re: date "n" date ago change with variable
thank you very much
:D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 12:14 AM
тАО02-27-2009 12:14 AM
Re: date "n" date ago change with variable
If you are happy with the answers you have gotten, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 12:56 AM
тАО02-27-2009 12:56 AM