lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invoking a script inside lilypond


From: Aaron Hill
Subject: Re: Invoking a script inside lilypond
Date: Thu, 14 Nov 2019 20:03:48 -0800
User-agent: Roundcube Webmail/1.3.8

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

[Prev in Thread] Current Thread [Next in Thread]