Update of /cvsroot/wisp/wisp/users/pisi
In directory sc8-pr-cvs1:/tmp/cvs-serv13493
Modified Files:
dialect.pisi.wim
Log Message:
introduced unix-command
Index: dialect.pisi.wim
===================================================================
RCS file: /cvsroot/wisp/wisp/users/pisi/dialect.pisi.wim,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dialect.pisi.wim 6 Feb 2003 16:14:27 -0000 1.4
+++ dialect.pisi.wim 9 Feb 2003 11:41:31 -0000 1.5
@@ -6,12 +6,30 @@
;;
;;;; @(#) $Id$
+(module dialect.pisi)
(export
- forever)
+ forever unix-command)
+
+(use lists strings unix)
;;; (forever ...) - do something forever.
(defmacro (forever . body)
`(let (loop)
(hide loop ,@body)
(loop)))
+
+;;; (unix-command "command with options" (pathref))
+(define (unix-command commando (*pathlist* '("/usr/bin" "/bin" "/sbin" "/usr/sbin")))
+ (if (not (any
+ (lambda (otsikoht)
+ (try
+ (begin
+ (my cmdlist (string->word-list commando)
+ (call-process `(,(string-append otsikoht "/" (first cmdlist)) ,@(cdr cmdlist))))
+ #t)
+ (except ()
+ #f)))
+ *pathlist*))
+ (raise 'no-command-in-path commando))
+)
|