#!/bin/sh for i in {1..3}; do echo With newline echo With newline echo "NO newline\c" sleep 10 echo With newline done #### local $SIG{ALRM} = sub { kill HUP => $pid; die "No data\n" }; #### local $SIG{ALRM} = sub { alarm 0; print "No data\n"; alarm $timeout }; #### With newline With newline No data No data No data NO newlineWith newline With newline With newline No data No data No data NO newlineWith newline With newline With newline No data No data No data NO newlineWith newline