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"