Skip to content

Instantly share code, notes, and snippets.

@artyom-poptsov
Created August 14, 2020 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artyom-poptsov/f76be508899d2f8645f032cf4682204c to your computer and use it in GitHub Desktop.
Save artyom-poptsov/f76be508899d2f8645f032cf4682204c to your computer and use it in GitHub Desktop.
#!/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