Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (use-modules (ice-9 popen)
- (ice-9 rdelim))
- (define (bash-reader command)
- (let* ((pipe (open-input-pipe command))
- (reader (read-delimited "EOF" pipe)))
- (close-pipe pipe)
- reader))
- (define (test)
- (bash-reader "ls / | awk 'NR==1'")) ;; => bin
- (display (equal? (test) "bin"))
- (newline)
Advertisement
Add Comment
Please, Sign In to add comment