
20 Jan
2021
20 Jan
'21
10:43 p.m.
On Tue, 12 Jan 2021 19:14:15 +0100 Pierre Neidhardt <mail@ambrevar.xyz> wrote:
Thanks for sharing, this could be interesting indeed. How would you run it in SLY or SLIME then? Do you have an example recipe? Oh, I missed this e-mail somehow. Here's an example:
(with-input-from-string (s (format nil "mypassword~%")) (uiop:run-program '("script" "-c" "sudo ls") :input s :output :string)) Notes: 1. sudo does have "-S" to prevent it from requiring a pty, but this was the original question, so it's what I used. 2. The parameter to "-c" ("sudo ls" above) will be interpreted by the shell.