- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: date format..
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
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
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
04-06-2009 08:56 PM
04-06-2009 08:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2009 09:28 PM
04-06-2009 09:28 PM
Re: date format..
See the output
[suraj@rspc521 root]# date +%a" "%b" "%d
Tue Apr 07
where
%d day of month (01..31)
%a localeâs abbreviated weekday name (Sun..Sat)
%b localeâs abbreviated month name (Jan..Dec)
for more information see the man page of date
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 02:25 AM
04-07-2009 02:25 AM
Re: date format..
For date format, you can check below link
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN1/0083____.HTM
Rgds//
Taifur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 02:58 AM
04-07-2009 02:58 AM
Re: date format..
Why would an HP-UX user wish to use a Tru64
"man" page for info like this? (And if he
_did_ want a Tru64 "man" page, why would he
want an old, obsolete one rather than the
latest one?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 03:01 AM
04-07-2009 03:01 AM
Re: date format..
#date +%a" "%b" "%e
Tue Apr 7
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 03:14 AM
04-07-2009 03:14 AM
Re: date format..
That was a Tru64 man page, accept no substitutes:
http://docs.hp.com/en/B2355-60130/date.1.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 04:42 AM
04-07-2009 04:42 AM
Re: date format..
VAR=$(date +%a" "%b" "%e)
print $VAR
Tue Apr 7
Cheerio friend
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 08:05 PM
04-07-2009 08:05 PM
Re: date format..
sdate=`date +%a" "%b" "%e`
awk '/'$sdate'/ {x++} /ORA-/ && x' alert.txt
syntax error The source line is 1.
The error context is
>>> /Wed <<<
awk: Quitting
The source line is 1.
thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 08:07 PM
04-07-2009 08:07 PM
Re: date format..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 11:00 PM
04-07-2009 11:00 PM
SolutionIf you want to find lines with the date then start printing lines with "ORA-", you could do:
awk -vvar="$sdate" '$0 ~ var {x++} /ORA-/ && x'
You can't stutter quotes if $sdata has white space. You must quote $sdata if you want to echo it, since it has multiple spaces.
Since you are using a variable and not a constant RE, you must use the ~ operator.