hi folks! I'm on my trip and inconvenient to meet you guys on IRC. Things gonna be normal next month.
Anyway, there's a problem for you. I'm trying to write a simple wrapper for "sed" with our popen module: --------------code------------ (use-modules (ice-9 popen) (rnrs)) (define (sed pattern str) (let ((p (open-input-output-pipe (string-append "sed " pattern)))) (display str p) (get-string-all p))) ----------------end------------- I expect it run like this: ----------------------- (sed "s:a:b:g" "abcabc") ==> "bbcbbc" ----------------------- But it halts that I have to interrupt. Is it accepted? Unlimited to "sed", I expect any shell cmd could be used in this way. And I think it's easy to implement it with fork-then-exec. But I think it's better do it with our (ice-9 popen). I think the alternative way would be: ------------------code---------------- (define (sed pattern str) (let ((p (open-input-output-pipe (string-append "echo -n " str "|sed " pattern)))) (get-string-all p))) -------------------end----------------- which works but less elegant to the former. Or anyone provide a better solution for shell cmd?