Advertisement
Guest User

Untitled

a guest
May 29th, 2018
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.50 KB | None | 0 0
  1. (defun do-shell (command)
  2.      (with-temp-buffer
  3.        (let ((proc (make-process
  4.                      :name "bash"
  5.                      :command `("/bin/bash" "-c" ,command)
  6.                      :buffer (current-buffer)
  7.                      :connection-type nil)))
  8.          (while (process-live-p proc)
  9.            (accept-process-output proc)))
  10.        (buffer-string)))
  11.  
  12. (make-thread (lambda ()
  13.               (setf result
  14.                 (list (do-shell "sleep 5")
  15.                       (do-shell "ping -c 5 www.google.com")
  16.                       (do-shell "host www.microsoft.com")))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement