From 5ba009a885bc01bb372b230bd8a39ef1c1fecd32 Mon Sep 17 00:00:00 2001 From: Jesse Gardner Date: Thu, 15 Apr 2021 19:05:53 -0700 Subject: [PATCH] Fixed write_pipe bug --- qq2clone | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qq2clone b/qq2clone index 629a35e..1f0102a 100755 --- a/qq2clone +++ b/qq2clone @@ -105,20 +105,21 @@ write_pipe () # OUTPUT: None # PARAMETERS: $1: '0' if passing another parameter(s), '1' if writing to # stdin instead. -# $2 and on: If $1 is 0, this is the information write_pipe will -# write as "$*" +# $2 and on: If $1 is 0, write_pipe will write the remaining parameters #=========================================================================# { # We put a + at the beginning of every line to let read_pipe work in a # non-blocking manner -if (($1)); then local line +if (($1)); then while IFS= read -r line; do echo "+$line" >&3 done else shift - echo "+$*" >&3 + echo "$@" | while IFS= read -r line; do + echo "+$line" >&3 + done fi return 0 }