Created
March 14, 2009 14:40
-
-
Save southly/79085 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/clisp | |
(write-line "Hello, World!") | |
;; 普通に書いてOK | |
;; 日本語を書くときは -E UTF-8 オプションを付けた方が無難かも | |
;; http://clisp.cons.org/impnotes/quickstart.html#quickstart-unix | |
;; http://clisp.cons.org/impnotes/quit.html | |
;; http://clisp.cons.org/impnotes/image.html | |
;; http://clisp.cons.org/impnotes/shell.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/clisp | |
(format *standard-output* "~{~A~^ ~}~%" *args*) | |
;; スクリプトの引数は ext:*args* にリストとして入っている |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/clisp | |
(print *load-pathname*) | |
(print *load-truename*) | |
;; スクリプトファイルのパスは | |
;; - *load-pathname* | |
;; - *load-truename* | |
;; に入っている |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/clisp | |
(format t "Read Line: ") | |
(force-output) | |
(format t "Input : ~A~%" (read-line *standard-input*)) | |
(terpri *standard-output*) | |
(write-line "stdout" *standard-output*) | |
(terpri *standard-output*) | |
(write-line "stderr" *error-output*) | |
;; *standard-input* : 標準入力 | |
;; *standard-output* : 標準出力 | |
;; *error-output* : 標準エラー出力 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/clisp | |
(format t "Read Line: ") | |
(force-output) | |
(let ((n (parse-integer (read-line *standard-input*) :junk-allowed t))) | |
(ext:exit n)) | |
;; exit status を指定したい場合は ext:exit を使用 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment