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
06-19-2001 05:42 AM
06-19-2001 05:42 AM
I just in need of U Guys help for a Script..
The thing I am trying is
* using /usr/include/sys/errno.h
I am trying to write a script which will accept error number as the input
and will give the detail on that error..
From errno.h I managed to extract the one line report for the given error number..
But then I need one more thing..
It should take the detailed description for that error from the man page of errno
and give me the description from that man page..
Example :
Suppose if I give number 227 for the script..
It should take the following line from /usr/include/sys/errno.h
and should extract ONLY THE DEFINITION of EADDRNOTAVAIL from man page..
Please give me a awk/sed script for doing this..
/usr/include/sys/errno.h
=========================
# define EADDRNOTAVAIL 227 /* Can't assign requested address */
Man page extract of ERRNO..
===========================
[EADDRNOTAVAIL]
Cannot assign requested address. Normally results from
an attempt to create a socket with an address not on
this machine.
[EAFNOSUPPORT] Address family not supported by protocol family. An
address incompatible with the requested protocol was
used. For example, you should not necessarily expect
to be able to use PUP Internet addresses with ARPA
Internet protocols.
Thanks for Ur time and the Help
Sundar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2001 07:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2001 08:09 AM
06-19-2001 08:09 AM
Re: Script
U really deserve 20 but then only 10 possible
Bye
Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2001 08:52 AM
06-19-2001 08:52 AM
Re: Script
STRING=$(awk -v NUM=$NUM '$4==NUM {print $3}' /usr/include/sys/errno.h)
man errno | eval sed -n '/.*${STRING}.*/,/^$/p'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2001 02:03 AM
06-20-2001 02:03 AM
Re: Script
Thanks to both..
But sorry I have to take Ur time once more.
Can U please explain how sed part really
cuts only that string from the file.
Sorry I am really new to Scripting..
Please help me out by explaining what it does..
Thanks
If possible U can leave Ur message at
SundarHp@Hotmail.com
Bye and waiting
Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2001 04:01 AM
06-20-2001 04:01 AM
Re: Script
sed looks for a match on the 1st address, and stops looking when it matches on the 2nd address.
The -n says "don't print anything", the p says "output only what matches". These two switched are invariably used together.
Robin