- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help in automatically removing lines.
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
тАО03-03-2010 01:58 AM
тАО03-03-2010 01:58 AM
Re: Help in automatically removing lines.
And will also read the whole file, then the first part again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 12:43 AM
тАО03-08-2010 12:43 AM
Re: Help in automatically removing lines.
I want to print the previous day date.
Please let me know how can i achieve it.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 12:49 AM
тАО03-08-2010 12:49 AM
Re: Help in automatically removing lines.
echo `(export TZ=XYZ+24; date "+%d/%m/%y")`
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 12:58 AM
тАО03-08-2010 12:58 AM
Re: Help in automatically removing lines.
Thanks a lot for your response
can you just brief what this command will do ?
Also what will happen at the starting of month. say jan 1. In that case will it display the last year an last month date ?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 01:01 AM
тАО03-08-2010 01:01 AM
Re: Help in automatically removing lines.
>Also what will happen at the starting of month. say jan 1. In that case will it display the last year an last month date ?
Yes, it will work. Will work also on March, 1 showing February 28/29 and so...
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 01:08 AM
тАО03-08-2010 01:08 AM
Re: Help in automatically removing lines.
I want to customize the year part of the o/p.
rt now its showing as 07/03/10 , iwant it in 07/03/2010.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 02:09 AM
тАО03-08-2010 02:09 AM
Re: Help in automatically removing lines.
Just change %y with %Y
man date should help.
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 04:46 AM
тАО03-08-2010 04:46 AM
Re: Help in automatically removing lines.
> I want to customize the year part of the o/p...its showing as 07/03/10 , i want it in 07/03/2010
# perl -MPOSIX -le 'print strftime "%02m/%02d/%Y",localtime(time-(60*60*24))'
...will give you yesterday's date correctly, crossing year boundaries as necessary.
You can change the format of the output just like you would using a simple 'date' command format.
Do *not* be fooled by trying to manipulate your 'TZ' variable by adding or subtracting 24-hours. This works correctly only for UTC (GMT) timezones. Use Perl;
Regards!
...JRF...
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 10:21 PM
тАО03-08-2010 10:21 PM
Re: Help in automatically removing lines.
Can you please explain this?
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2010 01:18 AM
тАО03-09-2010 01:18 AM
Re: Help in automatically removing lines.
The code in libc only expects to have valid timezones. These are UTC +/- 12 hours.
What you did was:
$ TZ=XYZ+24 date "+%d/%m/%y %Z"
08/03/10 XYZ
This converts to UTC time and adds 24 hours. What if there was a DST transition and you skip or lose a day?