- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: I want to get before two days...
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
03-13-2006 11:50 AM
03-13-2006 11:50 AM
I want to get before two days...
I'm making a script.
My system is HP-UX 11.0.
if input date command in my system
#date
Tue Mar 14 09:36:49 KST 2006
So I want to do
1. Today ::
#TZ=KST date +%Y%m%d
20060314
2. Before day ::
#TZ=KST+24 date +%Y%m%d
20060313
3. Next day ::
#TZ=KST-24 date +%Y%m%d
20060315
4. Before two days ::
???
Please tell me a solution method....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 12:00 PM
03-13-2006 12:00 PM
Re: I want to get before two days...
Mon Mar 13 01:57:08 2006
lt09:/home/merijn 103 > perl -le 'print scalar localtime time - 2 * 86400'
Sun Mar 12 01:57:14 2006
lt09:/home/merijn 104 > perl -le 'print scalar localtime time - 3 * 86400'
Sat Mar 11 01:57:17 2006
lt09:/home/merijn 105 > perl -le 'print scalar localtime time - 4 * 86400'
Fri Mar 10 01:57:20 2006
lt09:/home/merijn 106 > perl -le 'print scalar localtime time - 5 * 86400'
Thu Mar 9 01:57:24 2006
lt09:/home/merijn 107 >
or in your format
lt09:/home/merijn 109 > perl -e'@d=localtime time-2*86400;printf"%4d%02d%02d\n",1900+$d[5],++$d[4],$d[3]'
20060312
lt09:/home/merijn 110 > perl -e'@d=localtime time-3*86400;printf"%4d%02d%02d\n",1900+$d[5],++$d[4],$d[3]'
20060311
lt09:/home/merijn 111 > perl -e'@d=localtime time-4*86400;printf"%4d%02d%02d\n",1900+$d[5],++$d[4],$d[3]'
20060310
lt09:/home/merijn 112 > perl -e'@d=localtime time-5*86400;printf"%4d%02d%02d\n",1900+$d[5],++$d[4],$d[3]'
20060309
lt09:/home/merijn 113 >
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 12:55 PM
03-13-2006 12:55 PM
Re: I want to get before two days...
DT=$(caljd.sh -y -s $(caljd.sh -p 2))
echo "Two days ago in YYYYMMDD format was ${DT}"
Invoke as caljd.sh -u for full usage and many examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 05:20 PM
03-14-2006 05:20 PM
Re: I want to get before two days...
I had tried as follows:
#]perl -le 'print scalar localtime time - 86400'
#]
But, there was no any response.
Other perl commnad is same.
help me...please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 05:23 PM
03-14-2006 05:23 PM
Re: I want to get before two days...
Download caljd.sh script in ACS reply. IT is really useful. And try as said by ACS. Or get usage as,
./caljd.sh -u
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 05:39 PM
03-14-2006 05:39 PM
Re: I want to get before two days...
Solved problem by yours help..
I have get use to caljd.sh ^^;;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2006 11:31 AM
03-16-2006 11:31 AM