From 893b8f1b1030342896d43cbe59d21bd9b2eb18c5 Mon Sep 17 00:00:00 2001 From: Aleander Lehmann Date: Fri, 27 Mar 2026 21:29:05 +0000 Subject: [PATCH] fix indentation of cgi script examples --- wiki/source/cgi.md | 78 +++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/wiki/source/cgi.md b/wiki/source/cgi.md index 2f9f8f5..18b1b2e 100644 --- a/wiki/source/cgi.md +++ b/wiki/source/cgi.md @@ -125,64 +125,64 @@ would be noted in each example. - Perl (also works with .pl file extension): - #!/usr/bin/perl - print "Status: 200\n"; - print "Content-Type: text/plain\n"; - print "\n"; - print "Hello World!\n"; + #!/usr/bin/perl + print "Status: 200\n"; + print "Content-Type: text/plain\n"; + print "\n"; + print "Hello World!\n"; Note that Perl was the main language of choice back in the heyday of CGI programming. - Bourne shell script (also works with .sh file extension): - #!/bin/sh - echo "Status: 200" - echo "Content-Type: text/plain" - echo - echo "Hello World!" + #!/bin/sh + echo "Status: 200" + echo "Content-Type: text/plain" + echo + echo "Hello World!" - Python (usable under both 3.x and 2.x, also works with .py file extension): - #!/usr/bin/python - print("Status: 200") - print("Content-Type: text/plain") - print("") - print("Hello World!") + #!/usr/bin/python + print("Status: 200") + print("Content-Type: text/plain") + print("") + print("Hello World!") - AWK: - #!/usr/bin/awk -E - BEGIN { - print "Status: 200" - print "Content-Type: text/plain" - print - print "Hello World!" - } + #!/usr/bin/awk -E + BEGIN { + print "Status: 200" + print "Content-Type: text/plain" + print + print "Hello World!" + } - Lua (also works with .lua extension): - #!/usr/bin/lua - print("Status: 200") - print("Content-Type: text/plain") - print("") - print("Hello World!") + #!/usr/bin/lua + print("Status: 200") + print("Content-Type: text/plain") + print("") + print("Hello World!") - Tcl: - #!/usr/bin/tclsh - puts "Status: 200" - puts "Content-Type: text/plain" - puts "" - puts "Hello World!" + #!/usr/bin/tclsh + puts "Status: 200" + puts "Content-Type: text/plain" + puts "" + puts "Hello World!" - Common Lisp: - #!/usr/bin/sbcl --script - (progn - (princ "Status: 200") (terpri) - (princ "Content-Type: text/plain") (terpri) - (terpri) - (princ "Hello World!") (terpri) - ) + #!/usr/bin/sbcl --script + (progn + (princ "Status: 200") (terpri) + (princ "Content-Type: text/plain") (terpri) + (terpri) + (princ "Hello World!") (terpri) + ) Pick the language you like, put the script (or executable) in a file anywhere inside your `public_html` subdirectory