Rocking the blogosphere
Apple Online Store

Nice little bash function for determining the meaning of error codes

Here’s a cool idea from Deadman.org | Advancing in the Bash shell:

err ()
{
    grep --recursive --color=auto --recursive -- "$@" /usr/include/*/errno.h
    if [ "${?}" != 0 ]; then
        echo "Not found."
    fi
}

Then you can do stuff like:

15:07 marca@shifter:~$ err 23
#define ENFILE          23              /* Too many open files in system */

Del.icio.us Digg Reddit Technorati

Possibly related posts

No comments yet. Be the first.

Leave a reply

Apple Online Store
Apple Online Store