#!/bin/bash ctlPipe=/tmp/CNCCaptureCtl if [[ -p $ctlPipe ]] then echo snap > "$ctlPipe" sleep 0.5 for i in {1..600} do sleep 0.1 if [ -f /tmp/CNCCaptureRdy ]; then echo "redy" break fi done exit 0 else echo "no ctlPipe" exit 1 fi