Simple shell loop.
stdin
while read line; do echo "$line"; done
while :; do {{command}}; sleep 1; done