From 7ba96e9da14d05c79aa61a2b5e20665653765c9b Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Wed, 20 Apr 2022 09:40:55 +0200 Subject: [PATCH] support process substitution --- src/lib/init_import.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/init_import.sh b/src/lib/init_import.sh index edebae0..ba2db6c 100644 --- a/src/lib/init_import.sh +++ b/src/lib/init_import.sh @@ -17,6 +17,15 @@ function init_import() { files[$i]="${tmpdir}/${files[$i]//[^A-Za-z0-9._-]/_}" fi done + # read pipes if name starts with /dev/fd + for i in "${!files[@]}"; do + if [[ ${files[$i]} == "/dev/fd"* ]]; then + if ! cat "${files[$i]}" >"${tmpdir}/${files[$i]//[^A-Za-z0-9._-]/_}"; then + error "reading of ${files[$i]} failed!" + fi + files[$i]="${tmpdir}/${files[$i]//[^A-Za-z0-9._-]/_}" + fi + done # create a zip archive if there are multiple files if [[ ${#files[@]} -gt 1 ]]; then file="$tmpdir/Untitled.zip"