Re: Shell commands with output to string

2022-03-09 Thread Josselin Poiret
Hello Zelphir, Zelphir Kaltstahl writes: > I have questions regarding this workaround: > > Can you explain how and why this works? I have tried to make sense of it and > here are my notes so far (reference: > https://notabug.org/ZelphirKaltstahl/guile-examples/src/2dead9f7bb9b40fc26eb490a93e1dc

Re: Shell commands with output to string

2022-03-08 Thread Zelphir Kaltstahl
Hello Josselin and all! On 2/23/22 15:01, Josselin Poiret wrote: Hello, p...@thomasdanckaert.be writes: Hi, to throw in an example: I once used a function like the one below to handle stdout and stderr from external commands (from https://github.com/tdanckaert/jobview/blob/master/jobtools.

Re: Shell commands with output to string

2022-02-25 Thread Zelphir Kaltstahl
Hello Oliver! On 2/23/22 15:13, Olivier Dion wrote: On Wed, 23 Feb 2022, Zelphir Kaltstahl wrote: There's ton of missing stuffs in the standard library IMO. On top of my head, filesystem paths manipulation (e.g. path-join) is also one that is probably getting re-invented a lots. I actually

Re: Shell commands with output to string

2022-02-23 Thread Olivier Dion via General Guile related discussions
On Thu, 24 Feb 2022, Blake Shaw wrote: > Olivier Dion via General Guile related discussions > writes: >> This is great and should be merged into the standard library of Guile. >> Maybe not at it's (I have not read everything), but this would be trully >> benifical to all Guile users. >> > I very

Re: Shell commands with output to string

2022-02-23 Thread Blake Shaw
Olivier Dion via General Guile related discussions writes: > On Wed, 23 Feb 2022, Zelphir Kaltstahl > wrote: > >>> There's ton of missing stuffs in the standard library IMO. On top >>> of my >>> head, filesystem paths manipulation (e.g. path-join) is also one >>> that is >>> probably getting re

Re: Shell commands with output to string

2022-02-23 Thread Olivier Dion via General Guile related discussions
On Wed, 23 Feb 2022, Zelphir Kaltstahl wrote: >> There's ton of missing stuffs in the standard library IMO. On top of my >> head, filesystem paths manipulation (e.g. path-join) is also one that is >> probably getting re-invented a lots. > > I actually made something for that, trying to copy most

Re: Shell commands with output to string

2022-02-23 Thread Josselin Poiret
Hello, p...@thomasdanckaert.be writes: > Hi, > > to throw in an example: I once used a function like the one below to > handle stdout and stderr from external commands (from > https://github.com/tdanckaert/jobview/blob/master/jobtools.scm#L38 ). > Probably far from perfect (my first and only

Re: Shell commands with output to string

2022-02-22 Thread Zelphir Kaltstahl
Hi Alex! On 2/22/22 11:20, Alex Sassmannshausen wrote: Hi Zelphir, I think you want to be using the popen / pipe procedures for this. See https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Pipes.html for the chapter in the manual. Hope this helps :) Alex Zelphir Kaltstahl writes:

Re: Shell commands with output to string

2022-02-22 Thread Zelphir Kaltstahl
Hi all! On 2/22/22 12:20, Neil Jerram wrote: On Tue, 22 Feb 2022 at 10:23, Alex Sassmannshausen wrote: Hi Zelphir, I think you want to be using the popen / pipe procedures for this. See https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Pipes.html for the chapter in the manual. Anoth

Re: Shell commands with output to string

2022-02-22 Thread Zelphir Kaltstahl
Hi Oliver! On 2/22/22 17:33, Olivier Dion wrote: On Tue, 22 Feb 2022, Leo Butler wrote: Olivier Dion via General Guile related discussions writes: On Tue, 22 Feb 2022, Zelphir Kaltstahl wrote: Hello Guile users! How would I run a shell command from inside Guile and get its output as a st

Re: Shell commands with output to string

2022-02-22 Thread Olivier Dion via General Guile related discussions
On Tue, 22 Feb 2022, Leo Butler wrote: > Olivier Dion via General Guile related discussions > writes: > >> On Tue, 22 Feb 2022, Zelphir Kaltstahl wrote: >>> Hello Guile users! >>> >>> How would I run a shell command from inside Guile and get its output >>> as a string, instead of the output bein

Re: Shell commands with output to string

2022-02-22 Thread Leo Butler
Olivier Dion via General Guile related discussions writes: > On Tue, 22 Feb 2022, Zelphir Kaltstahl wrote: >> Hello Guile users! >> >> How would I run a shell command from inside Guile and get its output >> as a string, instead of the output being outputted directly? (Guile >> 3.0.8) > > I use t

Re: Shell commands with output to string

2022-02-22 Thread Olivier Dion via General Guile related discussions
On Tue, 22 Feb 2022, Zelphir Kaltstahl wrote: > Hello Guile users! > > How would I run a shell command from inside Guile and get its output > as a string, instead of the output being outputted directly? (Guile > 3.0.8) I use the following: (define-module (shell utils) #:use-module (ice-9 forma

Re: Shell commands with output to string

2022-02-22 Thread Neil Jerram
On Tue, 22 Feb 2022 at 10:23, Alex Sassmannshausen wrote: > > Hi Zelphir, > > I think you want to be using the popen / pipe procedures for this. See > https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Pipes.html > for the chapter in the manual. Another example, for reading transactions o

Re: Shell commands with output to string

2022-02-22 Thread post
Hi, to throw in an example: I once used a function like the one below to handle stdout and stderr from external commands (from https://github.com/tdanckaert/jobview/blob/master/jobtools.scm#L38 ). Probably far from perfect (my first and only scheme project...), but hopefully it gives you an

Re: Shell commands with output to string

2022-02-22 Thread Alex Sassmannshausen
Hi Zelphir, I think you want to be using the popen / pipe procedures for this. See https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Pipes.html for the chapter in the manual. Hope this helps :) Alex Zelphir Kaltstahl writes: > Corrections below. > > On 2/22/22 10:29, Zelphir Kaltstah

Re: Shell commands with output to string

2022-02-22 Thread tomas
On Tue, Feb 22, 2022 at 09:38:35AM +, Zelphir Kaltstahl wrote: > Corrections below. > > On 2/22/22 10:29, Zelphir Kaltstahl wrote: > > Hello Guile users! > > > > How would I run a shell command from inside Guile and get its output as > > a string, instead of the output being outputted directl

Re: Shell commands with output to string

2022-02-22 Thread Zelphir Kaltstahl
Corrections below. On 2/22/22 10:29, Zelphir Kaltstahl wrote: Hello Guile users! How would I run a shell command from inside Guile and get its output as a string, instead of the output being outputted directly? (Guile 3.0.8) So far I have found (system ...) which I tried to use w