LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] [TOTD] find error corresponding to number

[ILUG] [TOTD] find error corresponding to number

P at draigBrady.com P at draigBrady.com
Sat May 8 16:24:05 IST 2004


Paul Jakma wrote:
> On Sat, 8 May 2004 P at draigBrady.com wrote:
> 
> 
>>This one isn't over yet :-)
>>
>>strerror is now 73 bytes
>>
>>#!/bin/sh
>>echo "#include <errno.h>"|cpp -dD|egrep -w "#define E[^ ]+ *$1"
> 
> 
> 58 bytes... no, make that 44 bytes..
> 
> And it supports arbitrary errno.h files / isnt restricted to
> whichever one your system's cpp will find.

Nice try. The hard bit is finding the appropriate header files.
I'm now down to 60 bytes. It's beginning to look like Perl though.

#!/bin/sh
echo|cpp -includeerrno.h -dD|egrep -w "E[^ ]+ *$1"

-- 
Pádraig Brady - http://www.pixelbeat.org
--- Following generated by rotagator ---

When you install a package on linux, generally
detailed documentation is in /usr/share/doc/$PACKAGE/
and binaries are in /usr/bin/ or /bin.
You can get specifics on rpm distributions as follows:
rpm -ql -p package.rpm #show where files in RPM would be installed
rpm -ql    package     #show where files in package were installed
rpm -ql -f /path/file  #show files for package /path/file belongs to
--



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell