~mdw
/
rcheck
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check, rcheck: Propagate exit status better; capture lines more precisely.
[rcheck]
/
rcheck
diff --git
a/rcheck
b/rcheck
index
cd40440
..
318aab6
100755
(executable)
--- a/
rcheck
+++ b/
rcheck
@@
-12,11
+12,15
@@
do
prog=$(readlink "${prog##*/}")
done
prog=$(readlink "${prog##*/}")
done
+exec 4>&1
+rc=0
for host in "$@"; do
for host in "$@"; do
- { { { set +e
- tar czf - check check.d |
- ssh "$host" '
+ nrc=$(
+ exec 5>&1
+ { { { set +e
+ tar czf - check check.d |
+ ssh "$host" '
set -e
cd /tmp
set -e
cd /tmp
@@
-34,21
+38,25
@@
cd $tmpdir
tar xzf -
./check'
tar xzf -
./check'
- rc=$?; set -e
- case $rc in
- 0) ;;
- *) echo >&2 "remote check process failed (rc = $rc)" ;;
- esac
- } 1>&3; } 2>&1 |
- sed 's/^/!!! /'
- } 3>&1 |
-
if read
line; then
- cat <<EOF
+ rc=$?; set -e; echo $rc >&5
+
case $rc in
+
0) ;;
+
*) echo >&2 "remote check process failed (rc = $rc)" ;;
+
esac
+
} 1>&3; } 2>&1 |
+
sed 's/^/!!! /'
+
} 3>&1 |
+
if IFS= read -r
line; then
+
cat <<EOF
###--------------------------------------------------------------------------
### $host
$line
EOF
###--------------------------------------------------------------------------
### $host
$line
EOF
- cat
- fi
+ cat
+ fi >&4
+ )
+ if [ $nrc -gt $rc ]; then rc=$nrc; fi
done
done
+
+exit $rc