Guest User

Untitled

a guest
Jan 15th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. (use-modules (ice-9 popen)
  2. (ice-9 rdelim))
  3.  
  4. (define (bash-reader command)
  5. (let* ((pipe (open-input-pipe command))
  6. (reader (read-delimited "EOF" pipe)))
  7. (close-pipe pipe)
  8. reader))
  9.  
  10. (define (test)
  11. (bash-reader "ls / | awk 'NR==1'")) ;; => bin
  12.  
  13. (display (equal? (test) "bin"))
  14. (newline)
Advertisement
Add Comment
Please, Sign In to add comment