21 lines
402 B
Bash
Executable file
21 lines
402 B
Bash
Executable file
#!/bin/sh
|
|
|
|
error="write_to_session_record_port"
|
|
|
|
# create redirection
|
|
# file descripters
|
|
exec 11>&1 # stdout
|
|
exec 22>&2 # stderr
|
|
|
|
while true; do
|
|
# send stdout to stdout
|
|
# send stderr though pipe
|
|
output=$("$@" 2>&1 1>&11 | tee >(cat - >&22)) # return stderr to
|
|
# normal stderr as well
|
|
|
|
# check if error is in stderr
|
|
if echo "$output" | grep -q "$error"; then
|
|
continue
|
|
fi
|
|
break
|
|
done
|