Home > QNX > Shell Script to lookup QNX docs

Shell Script to lookup QNX docs

Here is a shell script that should run on any system with Python but I only tried it on Mac. It will lookup the QNX documentation for any library call you pass in on the command line.

This is how you use it:

  qnxhelp printf

And it will then open up a web browser with the docs for 6.4.1′s library page for printf.

Here is the script code for qnxhelp:

#!/usr/bin/env python
import os, string, sys, webbrowser
if (len(sys.argv) != 2):
    print "Usage:  %s <command to lookup>" %(sys.argv[0])

else:
    word = sys.argv[1]
    char = word[:1]
    location = "http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/%s/%s.html" % (string.lower(char), string.lower(word))    webbrowser.open(location)
Categories: QNX Tags:
  1. Steve Reid
    July 28th, 2010 at 11:49 | #1

    Interesting script, Dan — a “use” command for functions.

    As you can imagine, I know the Neutrino Library Reference well, so I thought I’d add a caveat: there are a few files that document several variations on the same function. For example, lgamma(), lgamma_r(), lgammaf(), and lgammaf_r() are all in l/lgamma.html, and ThreadCtl() and ThreadCtl_r() are both in t/threadctl.html. If the script doesn’t find the function you asked for, try using the base name. It should be possible to extend the script to try some alternatives — an exercise for the reader, perhaps.

    As a bonus, this script will work for any data structures and variables that have their own page in the Neutrino Library Reference.

    The 6.5.0 docs are in an Infocenter that uses Eclipse plugins, so you’ll need a slightly different URL.

  2. August 4th, 2010 at 16:35 | #2

    Thanks Steve. I’ll update for 6.5.0 soon.