On 2019-11-14 7:19 pm, Francesco Petrogalli wrote:
I would like to capture the output of a command line script into a
lilypond variable. Is there a way to do this?

I am trying to print the hash of a commit in the pdf, to version the file.

Neither ly:spawn nor system appear to capture stdout of the child process.

Looks like you have to jump through a few hoops:

;;;;
(use-modules (ice-9 popen) (ice-9 rdelim))
(let* ((port (open-input-pipe "date +%s"))
       (str (read-line port)))
  (close-pipe port) str)
;;;;


-- Aaron Hill

Reply via email to