Created
August 14, 2020 19:01
-
-
Save artyom-poptsov/f76be508899d2f8645f032cf4682204c 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
#!/usr/bin/guile \ | |
-L modules -e main -s | |
!# | |
(use-modules (oop goops) | |
(ssh session) | |
(ssh auth) | |
(metabash plumber) | |
(metabash diff)) | |
(define (main args) | |
(define session (make-session #:host "example.org")) | |
(connect! session) | |
(userauth-agent! session) | |
(let ((pipeline1 (plumb `(local "cat /etc/passwd"))) | |
(pipeline2 (plumb `(remote ,session "cat /etc/passwd")))) | |
(diff (pipeline-output-port pipeline1) | |
(pipeline-output-port pipeline2) | |
(current-output-port)) | |
(while (and (not (port-closed? (pipeline-output-port pipeline1))) | |
(not (port-closed? (pipeline-output-port pipeline2)))) | |
(sleep 1)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment