ambrevar/shell: Add tee.

master
Pierre Neidhardt 2021-01-13 19:07:14 +01:00
parent 40838e883c
commit f0cad5decb
1 changed files with 9 additions and 0 deletions

View File

@ -260,6 +260,15 @@ to get the final output as a string."
(values (uiop:process-info-output handler)
handler)))
(export-always 'tee)
(defun tee (input-stream)
"Return the INPUT-STREAM and its string representation as a second value."
(let ((result
(uiop:slurp-stream-string input-stream :stripped t)))
(values
(make-string-input-stream result)
result)))
(export-always 'disk-usage)
(defun disk-usage (files)
"Return disk usage of FILES in octets.