いろいろなコマンドでCGI

sh

#!/bin/sh
echo -e "Content-Type: text/plain\n\nHello sh"

awk

#!/usr/bin/awk -f
BEGIN{print "Content-Type: text/plain\n\nHello awk"}

make

#!/usr/bin/make -sf
all:
  echo -e "Content-Type: text/plain\n\nHello make"

sed

#!/bin/sed 1d
Content-Type: text/plain

Hello sed

egrep

#!/bin/egrep ^([^#]|$)
Content-Type: text/plain

Hello egrep

tail

#!/usr/bin/tail -3
Content-Type: text/plain

Hello tail

dc

#!/usr/bin/dc
[Hello dc] [] [Content-Type: text/plain] f

bc

#!/usr/bin/bc
"Content-Type: text/plain

Hello bc"
quit

printf

#!/usr/bin/printf Content-Type: text/plain\n\nHello printf

emacs

#!/usr/bin/emacs -script
(princ "Content-Type: text/plain\n\nHello emacs")

emacs lispを普通のスクリプト言語として遊ぶときのオプション

http://d.hatena.ne.jp/n9d/20080208/1202460240

未解決

#!/bin/echo -e Content-Type: text/plain\n\nHello echo
#!/bin/date +Content-Type: text/plain%n%nHello date
#!/usr/bin/gs -sDEVICE=nullpage
(Content-type: text/html\n\nhello ghostscript) ==
quit
#!/usr/bin/vim -s
:set viminfo=
:silent! !echo -e Content-Type: text/plain\\n\\nHello vim
:q!

/bin/cmd "-a -b -c def #comment" ./hoge.sh
⇒ 全ての引数がひとつにまとめられる

http://x68000.q-e-d.net/~68user/unix/pickup?%A5%B7%A5%A7%A5%D0%A5%F3%A5%B0

この仕様がきつい…