Philip Martin <philip.mar...@wandisco.com> writes: >>> > HTTPD_PORT=3691 >>> > -while netstat -an | grep $HTTPD_PORT | grep 'LISTEN' >/dev/null; do >>> > +while \ >>> > + (ss -ltn sport = :$HTTP_PORT 2>&1 | grep :$HTTP_PORT > /dev/null ) \ >>> > + || \ >>> > + (netstat -an 2>&1 | grep $HTTP_PORT | grep 'LISTEN' > /dev/null ) \ >>> > + do > > Looking at it again I'm more worried about the handling of the exit > statuses in the pipelines. Different shells have different behaviours.
I think it is probably OK in that regard. The ambiguity is what should be returned when multiple commands in a pipeline return non-zero, but the code is only looking to distinguish two cases: all commands in a pipeline return zero, one or more commands return non-zero. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*