Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I would like to put syntax-highlighted source code (C) on a website using CGI. I have the GNU source-highlight package on the web-server. Can anyone tell me how to link the source-highlight-cgi script (shell script, not perl) into CGI.

I guess I need a perl script in the cgi-bin to point somehow at the source-highlight-cgi shell script I but have no experience of doing this.

Note: CGI is enabled and working on the server.

share|improve this question
You just have to put that script into the cgi-bin directory and make it executable. What I can't tell you is how you specify the source file that needs highlighting via the URL. You may need to dive into the source to work out how do that. –  paulmorriss Jan 30 '12 at 16:57
There is a comment in the script (bourn shell, not perl) saying "This wrapper script should never be moved out of the build directory. If it is, it will not operate correctly.", so I need to call it from cgi-bin –  William Morris Jan 30 '12 at 19:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.