ctubbsii commented on a change in pull request #187: fixes #185 No longer write
to stdin
URL: https://github.com/apache/fluo-uno/pull/187#discussion_r204485527
##########
File path: bin/impl/util.sh
##########
@@ -59,3 +59,23 @@ function run_setup_script() {
shift
"$UNO_HOME/bin/impl/setup-$SCRIP.sh" "$@" 1>"$L_DIR/$SCRIP.stdout"
2>"$L_DIR/$SCRIP.stderr"
}
+
+function saveConsole {
+ UNO_CONSOLE=''
+ for fd in {0..200}; do
+ rco="$(true 2>/dev/null >&${fd}; echo $?)"
+ rci="$(true 2>/dev/null <&${fd}; echo $?)"
+ [[ "${rco}${rci}" = "11" ]] && UNO_CONSOLE=${fd} && break
+ done
+
+ exec {UNO_CONSOLE}>&1
+ export UNO_CONSOLE
+}
+
+function printToConsole {
+ if [ -z "$UNO_CONSOLE" ]; then
+ echo $1
+ else
+ echo >&${UNO_CONSOLE} $1
Review comment:
This redirect should not precede the arg. Should be before command or after
all args.
Also, instead of `$1` use quoted array: `"$@"` else you only print the first
arg.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services